]> git.localhorst.tv Git - blank.git/commitdiff
different docker exec approach
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 24 Nov 2016 10:32:30 +0000 (11:32 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 24 Nov 2016 10:34:38 +0000 (11:34 +0100)
scripts/docker/archlinux-build/Dockerfile
scripts/docker/archlinux-run/Dockerfile
scripts/docker/exec.bash
scripts/docker/ubuntu-build-latest/Dockerfile
scripts/docker/ubuntu-build-latest/env [deleted file]

index 12d26f60ce3cee6b72e29ddd226f562277bc2921..fe9592f39bb89219adada695bf82704e969049e5 100644 (file)
@@ -1,16 +1,10 @@
-FROM rafaelsoares/archlinux-devel
+FROM localhorsttv/archlinux-run:latest
 
-RUN sudo pacman -S --noconfirm \
+RUN pacman -S --needed --noconfirm \
+       base-devel \
        cppcheck \
        cppunit \
-       freealut \
        git \
-       glew \
        glm \
-       openal \
-       sdl2 \
-       sdl2_image \
-       sdl2_net \
-       sdl2_ttf \
-       zlib \
-       ;
+       && \
+       paccache -rk 0
index ed69ac9329b900ba7fa2e3be779df5c30d24f6c2..9bf76dbf8c2449a58d4185a6fc2eaf713ec8412f 100644 (file)
@@ -1,13 +1,25 @@
-FROM rafaelsoares/archlinux
+FROM base/archlinux
 
-RUN sudo pacman -S --noconfirm \
+RUN echo 'Server = http://mirror.23media.de/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \
+       pacman-key --init && \
+       pacman-key --populate archlinux && \
+       pacman -Sy --noconfirm archlinux-keyring && \
+       pacman -S --noconfirm pacman && \
+       pacman-db-upgrade && \
+       pacman -Su --noconfirm && \
+       pacman -S --noconfirm mesa-libgl xorg-server-xvfb && \
+       paccache -rk 0
+
+RUN pacman -S --needed --noconfirm \
        freealut \
        glew \
-       glm \
        openal \
        sdl2 \
        sdl2_image \
        sdl2_net \
        sdl2_ttf \
        zlib \
-       ;
+       && \
+       paccache -rk 0 && \
+       mkdir -p /etc/openal && \
+       echo -e '[general]\ndrivers = null' > /etc/openal/alsoft.conf
index faabff467b259a617162922154a933385ae6f879..824405970abb10dc462a20db015de1cd430ea61f 100755 (executable)
@@ -4,30 +4,27 @@
 # environment varables:
 #   IMAGE:    name of the docker image to use
 #   TARGETS:  targets to pass to `make` inside the container
-#   PASS_ENV: names of environment variables to import into
-#             the container during build
+#   KEEP:     file names to copy back out after all TARGETS have run
 
 IMAGE="${IMAGE:-archlinux-build}"
 
 image_name="localhorsttv/${IMAGE}"
 image_path="scripts/docker/${IMAGE//:/-}"
 
-build_cmd="cd /repo && make -j\$(nproc) $TARGETS"
+xvfb_cmd="xvfb-run -a --server-args='-screen 0 1024x768x24 +extension RANDR +extension GLX'"
 
-local_conf=""
+build_cmd="git clone /repo /workdir && cd /workdir && make -j\$(nproc) $TARGETS"
 
-if [[ "$TARGETS" == *codecov* ]]; then
-       local_conf="$local_conf $(bash <(curl -s https://codecov.io/env))"
+if [[ "$KEEP" != "" ]]; then
+       build_cmd="${build_cmd} && cp -Rv $KEEP /repo"
 fi
 
-if [ -e "${image_path}/env" ]; then
-       local_conf="$local_conf --env-file ${image_path}/env"
-fi
 
-# copy XDG_RUNTIME_DIR if set
-if [ "$XDG_RUNTIME_DIR" != "" ]; then
-       local_conf="$local_conf -e XDG_RUNTIME_DIR='$XDG_RUNTIME_DIR'"
+local_conf=""
+
+if [[ "$TARGETS" == *codecov* ]]; then
+       local_conf="$local_conf $(bash <(curl -s https://codecov.io/env))"
 fi
 
 docker build -t "${image_name}" --pull=true "${image_path}"
-docker run -v "$PWD":/repo ${local_conf} "${image_name}" xvfb-run --server-args="-screen 0 1024x768x24" bash -c "env ; glewinfo | head ; ${build_cmd}"
+docker run -v "$PWD":/repo ${local_conf} "${image_name}" sh -c "$xvfb_cmd sh -c 'env ; glewinfo | head ; ${build_cmd}'"
index ae344bd3c1da7db175506894c3384bd6cfb68b51..15a23de147274ef61f60a70819743334d041b362 100644 (file)
@@ -15,3 +15,5 @@ RUN apt -y install --no-install-recommends \
        libsdl2-ttf-dev \
        zlib1g-dev \
        ;
+
+ENV LDXXFLAGS=-L/usr/lib/x86_64-linux-gnu LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
diff --git a/scripts/docker/ubuntu-build-latest/env b/scripts/docker/ubuntu-build-latest/env
deleted file mode 100644 (file)
index 13f8143..0000000
+++ /dev/null
@@ -1 +0,0 @@
-LDXXFLAGS=-L/usr/lib/x86_64-linux-gnu