From 9773d2963d63747fa4bfc548c6a7603fabcd865b Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 7 Dec 2017 16:26:28 +0100 Subject: [PATCH] stolen dockerfiles from blank --- scripts/docker/archlinux-build/Dockerfile | 16 +++----- scripts/docker/archlinux-run/Dockerfile | 39 +++++++++++++------ scripts/docker/centos-build-latest/Dockerfile | 32 +++++++-------- scripts/docker/centos-run-latest/Dockerfile | 26 +++++++++++++ scripts/docker/debian-build-latest/Dockerfile | 9 +++-- .../docker/debian-build-testing/Dockerfile | 9 +++-- scripts/docker/debian-run-latest/Dockerfile | 27 +++++++++++++ scripts/docker/debian-run-testing/Dockerfile | 26 +++++++++++++ scripts/docker/exec.bash | 18 +++++---- scripts/docker/ubuntu-build-devel/Dockerfile | 9 +++-- scripts/docker/ubuntu-build-latest/Dockerfile | 11 ++++-- scripts/docker/ubuntu-run-devel/Dockerfile | 27 +++++++++++++ scripts/docker/ubuntu-run-latest/Dockerfile | 28 +++++++++++++ 13 files changed, 218 insertions(+), 59 deletions(-) create mode 100644 scripts/docker/centos-run-latest/Dockerfile create mode 100644 scripts/docker/debian-run-latest/Dockerfile create mode 100644 scripts/docker/debian-run-testing/Dockerfile create mode 100644 scripts/docker/ubuntu-run-devel/Dockerfile create mode 100644 scripts/docker/ubuntu-run-latest/Dockerfile diff --git a/scripts/docker/archlinux-build/Dockerfile b/scripts/docker/archlinux-build/Dockerfile index 12d26f6..fe9592f 100644 --- a/scripts/docker/archlinux-build/Dockerfile +++ b/scripts/docker/archlinux-build/Dockerfile @@ -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 diff --git a/scripts/docker/archlinux-run/Dockerfile b/scripts/docker/archlinux-run/Dockerfile index ed69ac9..eeca2ca 100644 --- a/scripts/docker/archlinux-run/Dockerfile +++ b/scripts/docker/archlinux-run/Dockerfile @@ -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 \ ; diff --git a/scripts/docker/centos-build-latest/Dockerfile b/scripts/docker/centos-build-latest/Dockerfile index 3331276..6e8d3cb 100644 --- a/scripts/docker/centos-build-latest/Dockerfile +++ b/scripts/docker/centos-build-latest/Dockerfile @@ -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 index 0000000..48074a8 --- /dev/null +++ b/scripts/docker/centos-run-latest/Dockerfile @@ -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 \ + ; diff --git a/scripts/docker/debian-build-latest/Dockerfile b/scripts/docker/debian-build-latest/Dockerfile index 79b8fcf..b0cccd6 100644 --- a/scripts/docker/debian-build-latest/Dockerfile +++ b/scripts/docker/debian-build-latest/Dockerfile @@ -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 \ ; diff --git a/scripts/docker/debian-build-testing/Dockerfile b/scripts/docker/debian-build-testing/Dockerfile index 8b422ea..b5a1eb8 100644 --- a/scripts/docker/debian-build-testing/Dockerfile +++ b/scripts/docker/debian-build-testing/Dockerfile @@ -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 index 0000000..9b238a9 --- /dev/null +++ b/scripts/docker/debian-run-latest/Dockerfile @@ -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 index 0000000..8538b75 --- /dev/null +++ b/scripts/docker/debian-run-testing/Dockerfile @@ -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 \ + ; diff --git a/scripts/docker/exec.bash b/scripts/docker/exec.bash index 9874c9a..ea6f97d 100755 --- a/scripts/docker/exec.bash +++ b/scripts/docker/exec.bash @@ -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}'" diff --git a/scripts/docker/ubuntu-build-devel/Dockerfile b/scripts/docker/ubuntu-build-devel/Dockerfile index 0415f52..15e0624 100644 --- a/scripts/docker/ubuntu-build-devel/Dockerfile +++ b/scripts/docker/ubuntu-build-devel/Dockerfile @@ -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 \ ; diff --git a/scripts/docker/ubuntu-build-latest/Dockerfile b/scripts/docker/ubuntu-build-latest/Dockerfile index ae344bd..e319fc4 100644 --- a/scripts/docker/ubuntu-build-latest/Dockerfile +++ b/scripts/docker/ubuntu-build-latest/Dockerfile @@ -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 index 0000000..6ce4106 --- /dev/null +++ b/scripts/docker/ubuntu-run-devel/Dockerfile @@ -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 index 0000000..dbda152 --- /dev/null +++ b/scripts/docker/ubuntu-run-latest/Dockerfile @@ -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 -- 2.39.2