]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
docker: Add Debian image with basic build environment
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Nov 2018 19:47:02 +0000 (19:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Nov 2018 19:48:16 +0000 (19:48 +0000)
By running "./make.sh docker" the current build environment
will be mounted into a Debian-based docker container.

This clean build environment can be used to compile the
toolchain or something...

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh
tools/docker/Dockerfile [new file with mode: 0644]

diff --git a/make.sh b/make.sh
index dee5e74e737c807a5b2632b2c616530285bbb448..7e9cd6d9d862154c5f0c839e767725509d0dbbc9 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1768,6 +1768,20 @@ clean)
        rm -f $BASEDIR/ipfire-*
        print_status DONE
        ;;
+docker)
+       # Build the docker image if it does not exist, yet
+       if ! docker images -a | grep -q ^ipfire-builder; then
+               if docker build -t ipfire-builder ${BASEDIR}/tools/docker; then
+                       print_status DONE
+               else
+                       print_status FAIL
+                       exit 1
+               fi
+       fi
+
+       # Run the container and enter a shell
+       docker run -it --privileged -v "${BASEDIR}:/build" -w "/build" ipfire-builder bash -l
+       ;;
 downloadsrc)
        if [ ! -d $BASEDIR/cache ]; then
                mkdir $BASEDIR/cache
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
new file mode 100644 (file)
index 0000000..02ec146
--- /dev/null
@@ -0,0 +1,21 @@
+# This image is based on the latest stable version of Debian
+FROM debian:stable
+
+# Install all updates
+RUN apt-get update && apt-get dist-upgrade
+
+# Install all packages needed for the build
+RUN apt-get install -y \
+       build-essential \
+       autoconf \
+       automake \
+       bison \
+       flex \
+       gawk \
+       git \
+       libz-dev
+
+# Enable colors in git
+RUN git config --global color.ui auto
+
+WORKDIR ~