add docker build
First passing build with a container. The `Dockerfile` contains a current set of build dependencies to install on Unbuntu Server 22.04 as of the time of this commit
This commit is contained in:
parent
2e55c044ca
commit
902db2a368
|
@ -0,0 +1,28 @@
|
|||
FROM ubuntu:22.04
|
||||
|
||||
ARG UNAME=build
|
||||
ARG UID=1000
|
||||
ARG GID=1000
|
||||
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC \
|
||||
apt-get install -y \
|
||||
sudo time git make curl wget subversion build-essential gcc file bc cpio gawk flex gettext unzip grep rsync pkg-config \
|
||||
openssl libssl-dev libncurses5-dev zlib1g-dev libwayland-dev libkf5config-dev-bin libkf5coreaddons-dev-bin \
|
||||
python3 python3-distutils \
|
||||
qttools5-dev qttools5-dev-tools qtdeclarative5-dev && \
|
||||
apt-get clean
|
||||
|
||||
VOLUME ["/ccache"]
|
||||
VOLUME ["/downloads"]
|
||||
VOLUME ["/src"]
|
||||
|
||||
ENV BR2_DL_DIR="/downloads"
|
||||
ENV BR2_CCACHE_DIR="/ccache"
|
||||
|
||||
RUN groupadd -g $GID -o $UNAME && useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
|
||||
USER $UNAME
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
CMD ["/bin/bash"]
|
18
README.md
18
README.md
|
@ -51,6 +51,24 @@ The following system packages are required to build the image:
|
|||
- wget
|
||||
- qtdeclarative5-dev
|
||||
|
||||
#### Docker Build Environment
|
||||
To build the build environment run the following from the root folder of the project:
|
||||
```sh
|
||||
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t buildroot-agent .
|
||||
```
|
||||
|
||||
To execute a build, run the following, replacing <MAKE_ARG> with an argument to be passed in to `make`, such as `clean` or `rpi4_64-gui`
|
||||
```sh
|
||||
docker run -v ./:/src -v ./ccache/:/ccache -v ../downloads/:/downloads --entrypoint /usr/bin/make -e BR2_JLEVEL=$(nproc) buildroot <MAKE_ARG>
|
||||
```
|
||||
Adjust paths to the `/ccache` and `/downloads` volumes accordingly. If these are not passed in, the caches will reside inside the container file system.
|
||||
|
||||
On `podman`, the Dockerfile has been configured to run as a user with the same uid/gid as the current user (passed in as a build-arg).
|
||||
This will require passing the --userns=keep-id argument, e.g.:
|
||||
```sh
|
||||
podman run --userns=keep-id -v ./:/src -v ./ccache/:/ccache -v ../downloads/:/downloads --entrypoint /usr/bin/make -e BR2_JLEVEL=$(nproc) buildroot clean
|
||||
```
|
||||
|
||||
#### The following firewall ports need to be allowed to the internet.
|
||||
In addition to the usual http/https ports (tcp 80, tcp 443) a couple of other ports need to be allowed to the internet :
|
||||
- tcp 9418 (git).
|
||||
|
|
Loading…
Reference in New Issue