]> git.localhorst.tv Git - blobs.git/commitdiff
stolen dockerfiles from blank
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 7 Dec 2017 15:26:28 +0000 (16:26 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 7 Dec 2017 15:26:28 +0000 (16:26 +0100)
13 files changed:
scripts/docker/archlinux-build/Dockerfile
scripts/docker/archlinux-run/Dockerfile
scripts/docker/centos-build-latest/Dockerfile
scripts/docker/centos-run-latest/Dockerfile [new file with mode: 0644]
scripts/docker/debian-build-latest/Dockerfile
scripts/docker/debian-build-testing/Dockerfile
scripts/docker/debian-run-latest/Dockerfile [new file with mode: 0644]
scripts/docker/debian-run-testing/Dockerfile [new file with mode: 0644]
scripts/docker/exec.bash
scripts/docker/ubuntu-build-devel/Dockerfile
scripts/docker/ubuntu-build-latest/Dockerfile
scripts/docker/ubuntu-run-devel/Dockerfile [new file with mode: 0644]
scripts/docker/ubuntu-run-latest/Dockerfile [new file with mode: 0644]

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..eeca2ca2c031d8ae98f716cf422fe650cfe10a65 100644 (file)
@@ -1,13 +1,30 @@
-FROM rafaelsoares/archlinux
+FROM base/archlinux
 
-RUN sudo pacman -S --noconfirm \
-       freealut \
-       glew \
-       glm \
-       openal \
-       sdl2 \
-       sdl2_image \
-       sdl2_net \
-       sdl2_ttf \
-       zlib \
+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 \
+               git \
+               make \
+               mesa-libgl \
+               xorg-server-xvfb \
+       && paccache -rk 0 \
+       ;
+
+RUN pacman -S --needed --noconfirm \
+               freealut \
+               glew \
+               openal \
+               sdl2 \
+               sdl2_image \
+               sdl2_net \
+               sdl2_ttf \
+               zlib \
+       && paccache -rk 0 \
+       && mkdir -p /etc/openal \
+       && printf '[general]\ndrivers = null\n' > /etc/openal/alsoft.conf \
        ;
index 33312768d3abc9bc15ae0b058441f0a355a7958b..6e8d3cb1cf156212b0b863162c433703be6ae7b3 100644 (file)
@@ -1,19 +1,17 @@
-FROM centos:latest
+FROM localhorsttv/centos-run:latest
 
-RUN yum -y update \
-       && yum -y install epel-release \
-       && yum -y update \
-       && yum -y group install "Development Tools"
-RUN yum -y install \
-       cppcheck \
-       cppunit-devel \
-       freealut-devel \
-       glew-devel \
-       glm-devel \
-       openal-soft-devel \
-       SDL2-devel \
-       SDL2_image-devel \
-       SDL2_net-devel \
-       SDL2_ttf-devel \
-       zlib-devel \
+RUN yum -y group install "Development Tools" \
+       && yum -y install \
+               cppcheck \
+               cppunit-devel \
+               freealut-devel \
+               glew-devel \
+               glm-devel \
+               openal-soft-devel \
+               SDL2-devel \
+               SDL2_image-devel \
+               SDL2_net-devel \
+               SDL2_ttf-devel \
+               zlib-devel \
+       && yum -y clean packages \
        ;
diff --git a/scripts/docker/centos-run-latest/Dockerfile b/scripts/docker/centos-run-latest/Dockerfile
new file mode 100644 (file)
index 0000000..48074a8
--- /dev/null
@@ -0,0 +1,26 @@
+FROM centos:latest
+
+RUN yum -y update \
+       && yum -y install epel-release \
+       && yum -y update \
+       && yum -y install \
+               git \
+               make \
+               which \
+               xorg-x11-server-utils \
+               xorg-x11-server-Xvfb \
+       && yum -y clean packages \
+       ;
+
+RUN yum -y install \
+       freealut \
+       glew \
+       openal-soft \
+       SDL2 \
+       SDL2_image \
+       SDL2_net \
+       SDL2_ttf \
+       zlib \
+       && yum -y clean packages \
+       && printf '[general]\ndrivers = null\n' > /etc/openal/alsoft.conf \
+       ;
index 79b8fcf5923380dc2ece8e8fe71562b326695e93..b0cccd65f44a456220d6cb1eb4a416df79fa08b9 100644 (file)
@@ -1,7 +1,9 @@
-FROM debian:latest
+FROM localhorsttv/debian-run:latest
+
+RUN apt -y install build-essential \
+       && apt-get -y clean \
+       ;
 
-RUN apt update \
-       && apt -y install build-essential
 RUN apt -y install --no-install-recommends \
        cppcheck \
        libalut-dev \
@@ -14,4 +16,5 @@ RUN apt -y install --no-install-recommends \
        libsdl2-net-dev \
        libsdl2-ttf-dev \
        zlib1g-dev \
+       && apt-get -y clean \
        ;
index 8b422eaa300474dde66bc821e6bb842ba61578ee..b5a1eb80cc16f19558a42848c7283d103d327a36 100644 (file)
@@ -1,7 +1,9 @@
-FROM debian:testing
+FROM localhorsttv/debian-run:testing
+
+RUN apt -y install build-essential \
+       && apt-get -y clean \
+       ;
 
-RUN apt update \
-       && apt -y install build-essential
 RUN apt -y install --no-install-recommends \
        cppcheck \
        libalut-dev \
@@ -14,4 +16,5 @@ RUN apt -y install --no-install-recommends \
        libsdl2-net-dev \
        libsdl2-ttf-dev \
        zlib1g-dev \
+       && apt-get -y clean \
        ;
diff --git a/scripts/docker/debian-run-latest/Dockerfile b/scripts/docker/debian-run-latest/Dockerfile
new file mode 100644 (file)
index 0000000..9b238a9
--- /dev/null
@@ -0,0 +1,27 @@
+FROM debian:latest
+
+RUN apt -y update \
+       && apt -y upgrade \
+       && apt -y install --no-install-recommends \
+               git \
+               make \
+               xauth \
+               xvfb \
+       && apt-get -y clean \
+       ;
+
+RUN apt -y install --no-install-recommends \
+               libalut0 \
+               libglew1.10 \
+               libglu1-mesa \
+               libopenal1 \
+               libsdl2-2.0-0 \
+               libsdl2-image-2.0-0 \
+               libsdl2-net-2.0-0 \
+               libsdl2-ttf-2.0-0 \
+               zlib1g \
+       && apt-get -y clean \
+       && printf '[general]\ndrivers = null\n' > /etc/openal/alsoft.conf \
+       ;
+
+ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu
diff --git a/scripts/docker/debian-run-testing/Dockerfile b/scripts/docker/debian-run-testing/Dockerfile
new file mode 100644 (file)
index 0000000..8538b75
--- /dev/null
@@ -0,0 +1,26 @@
+FROM debian:testing
+
+RUN apt -y update \
+       && apt -y upgrade \
+       && apt -y install --no-install-recommends \
+               dbus \
+               git \
+               make \
+               xauth \
+               xvfb \
+       && apt-get -y clean \
+       ;
+
+RUN apt -y install --no-install-recommends \
+               libalut0 \
+               libglew1.10 \
+               libglu1-mesa \
+               libopenal1 \
+               libsdl2-2.0-0 \
+               libsdl2-image-2.0-0 \
+               libsdl2-net-2.0-0 \
+               libsdl2-ttf-2.0-0 \
+               zlib1g \
+       && apt-get -y clean \
+       && printf '[general]\ndrivers = null\n' > /etc/openal/alsoft.conf \
+       ;
index 9874c9a9f49fbe0b4db2d0d06e790f557eeb89b6..ea6f97daa93e1825dcaeeca1616ca9cafb38953e 100755 (executable)
@@ -4,15 +4,21 @@
 # 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'"
+
+build_cmd="cp -R /repo /workdir && cd /workdir && make -j\$(nproc) $TARGETS"
+
+if [[ "$KEEP" != "" ]]; then
+       build_cmd="${build_cmd} && cp -Rv $KEEP /repo"
+fi
+
 
 local_conf=""
 
@@ -20,9 +26,5 @@ if [[ "$TARGETS" == *codecov* ]]; then
        local_conf="$local_conf $(bash <(curl -s https://codecov.io/env))"
 fi
 
-if [ -e "${image_path}/env" ]; then
-       local_conf="$local_conf --env-file ${image_path}/env"
-fi
-
 docker build -t "${image_name}" --pull=true "${image_path}"
-docker run -v "$PWD":/repo ${local_conf} "${image_name}" /bin/bash -c "${build_cmd}"
+docker run -v "$PWD":/repo ${local_conf} "${image_name}" sh -c "$xvfb_cmd sh -c '${build_cmd}'"
index 0415f526a1c7ae78fe54400eeb32d5ea1bd3bf18..15e0624b052d18038dc0db1a076100923e1c74cd 100644 (file)
@@ -1,7 +1,9 @@
-FROM ubuntu:devel
+FROM localhorsttv/ubuntu-run:devel
+
+RUN apt -y install build-essential \
+       && apt-get -y clean \
+       ;
 
-RUN apt update \
-       && apt -y install build-essential
 RUN apt -y install --no-install-recommends \
        cppcheck \
        libalut-dev \
@@ -14,4 +16,5 @@ RUN apt -y install --no-install-recommends \
        libsdl2-net-dev \
        libsdl2-ttf-dev \
        zlib1g-dev \
+       && apt-get -y clean \
        ;
index ae344bd3c1da7db175506894c3384bd6cfb68b51..e319fc4916d979e550fba1fbc7f387787809d49e 100644 (file)
@@ -1,7 +1,9 @@
-FROM ubuntu:latest
+FROM localhorsttv/ubuntu-run:latest
+
+RUN apt -y install build-essential \
+       && apt-get -y clean \
+       ;
 
-RUN apt update \
-       && apt -y install build-essential
 RUN apt -y install --no-install-recommends \
        cppcheck \
        libalut-dev \
@@ -14,4 +16,7 @@ RUN apt -y install --no-install-recommends \
        libsdl2-net-dev \
        libsdl2-ttf-dev \
        zlib1g-dev \
+       && apt-get -y clean \
        ;
+
+ENV LDXXFLAGS -L/usr/lib/x86_64-linux-gnu
diff --git a/scripts/docker/ubuntu-run-devel/Dockerfile b/scripts/docker/ubuntu-run-devel/Dockerfile
new file mode 100644 (file)
index 0000000..6ce4106
--- /dev/null
@@ -0,0 +1,27 @@
+FROM ubuntu:devel
+
+RUN apt -y update \
+       && apt -y upgrade \
+       && apt -y install --no-install-recommends \
+               dbus \
+               git \
+               make \
+               xauth \
+               xvfb \
+       && apt-get -y clean \
+       ;
+
+
+RUN apt -y install --no-install-recommends \
+               libalut0 \
+               libglew1.10 \
+               libglu1-mesa \
+               libopenal1 \
+               libsdl2-2.0-0 \
+               libsdl2-image-2.0-0 \
+               libsdl2-net-2.0-0 \
+               libsdl2-ttf-2.0-0 \
+               zlib1g \
+       && apt-get -y clean \
+       && printf '[general]\ndrivers = null\n' > /etc/openal/alsoft.conf \
+       ;
diff --git a/scripts/docker/ubuntu-run-latest/Dockerfile b/scripts/docker/ubuntu-run-latest/Dockerfile
new file mode 100644 (file)
index 0000000..dbda152
--- /dev/null
@@ -0,0 +1,28 @@
+FROM ubuntu:latest
+
+RUN apt update \
+       && apt -y upgrade \
+       && apt -y install --no-install-recommends \
+               dbus \
+               git \
+               make \
+               xauth \
+               xvfb \
+       && apt-get -y clean \
+       ;
+
+RUN apt -y install --no-install-recommends \
+               libalut0 \
+               libglew1.10 \
+               libglu1-mesa \
+               libopenal1 \
+               libsdl2-2.0-0 \
+               libsdl2-image-2.0-0 \
+               libsdl2-net-2.0-0 \
+               libsdl2-ttf-2.0-0 \
+               zlib1g \
+       && apt-get -y clean \
+       && printf '[general]\ndrivers = null\n' > /etc/openal/alsoft.conf \
+       ;
+
+ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu