From cb1943f56f40c099b9aa77d8f3aa9e8262950560 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 15 Mar 2020 23:13:35 +0100 Subject: Adding Docker container files for Fedora 30. --- docker/fedora30/build/Dockerfile | 17 ++++++++++ docker/fedora30/build/build_image.sh | 16 +++++++++ docker/fedora30/build/docker-compose.yml | 22 ++++++++++++ docker/fedora30/build/readme.rst | 43 ++++++++++++++++++++++++ docker/fedora30/build/start_build_shell.sh | 18 ++++++++++ docker/fedora30/build/startup/setup_container.sh | 10 ++++++ docker/fedora30/build/stop_build_shell.sh | 17 ++++++++++ docker/fedora30/test/Dockerfile | 10 ++++++ docker/fedora30/test/build_image.sh | 16 +++++++++ docker/fedora30/test/docker-compose.yml | 22 ++++++++++++ docker/fedora30/test/readme.rst | 43 ++++++++++++++++++++++++ docker/fedora30/test/start_test_shell.sh | 18 ++++++++++ docker/fedora30/test/startup/setup_container.sh | 10 ++++++ docker/fedora30/test/stop_test_shell.sh | 17 ++++++++++ 14 files changed, 279 insertions(+) create mode 100644 docker/fedora30/build/Dockerfile create mode 100755 docker/fedora30/build/build_image.sh create mode 100644 docker/fedora30/build/docker-compose.yml create mode 100644 docker/fedora30/build/readme.rst create mode 100755 docker/fedora30/build/start_build_shell.sh create mode 100755 docker/fedora30/build/startup/setup_container.sh create mode 100755 docker/fedora30/build/stop_build_shell.sh create mode 100644 docker/fedora30/test/Dockerfile create mode 100755 docker/fedora30/test/build_image.sh create mode 100644 docker/fedora30/test/docker-compose.yml create mode 100644 docker/fedora30/test/readme.rst create mode 100755 docker/fedora30/test/start_test_shell.sh create mode 100755 docker/fedora30/test/startup/setup_container.sh create mode 100755 docker/fedora30/test/stop_test_shell.sh diff --git a/docker/fedora30/build/Dockerfile b/docker/fedora30/build/Dockerfile new file mode 100644 index 0000000..c62037b --- /dev/null +++ b/docker/fedora30/build/Dockerfile @@ -0,0 +1,17 @@ +# Building an SCons Release Build image under Fedora 30 +FROM fedora:30 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Release Build, based on a Fedora 30" + +# Install additional packages +RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano + +# Install hyphenation patterns for FOP +RUN mkdir /opt/offo && cd /opt/offo && curl -L --output offo-hyphenation-compiled.zip https://sourceforge.net/projects/offo/files/offo-hyphenation/2.2/offo-hyphenation-compiled.zip/download && unzip offo-hyphenation-compiled.zip && cp offo-hyphenation-compiled/fop-hyph.jar /usr/share/fop/ + +# Epydoc can be installed via pip3, but it doesn't seem to work properly. +# For the moment we don't install it and might replace it with Sphinx later... +# RUN dnf -y install python3-pip && pip3 install epydoc + +CMD ["/bin/bash"] + diff --git a/docker/fedora30/build/build_image.sh b/docker/fedora30/build/build_image.sh new file mode 100755 index 0000000..afd04b8 --- /dev/null +++ b/docker/fedora30/build/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-build-fedora30:latest -t scons-build-fedora30:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/docker/fedora30/build/docker-compose.yml b/docker/fedora30/build/docker-compose.yml new file mode 100644 index 0000000..86f3031 --- /dev/null +++ b/docker/fedora30/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-build-fedora30:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Build_Fedora30 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/docker/fedora30/build/readme.rst b/docker/fedora30/build/readme.rst new file mode 100644 index 0000000..18ac401 --- /dev/null +++ b/docker/fedora30/build/readme.rst @@ -0,0 +1,43 @@ +================================== +Image for building/releasing SCons +================================== + +This folder contains the files and scripts that can be used to +build and release SCons, based on a Fedora 30. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_build_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the build image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_build_shell.sh + +. + diff --git a/docker/fedora30/build/start_build_shell.sh b/docker/fedora30/build/start_build_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/docker/fedora30/build/start_build_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/docker/fedora30/build/startup/setup_container.sh b/docker/fedora30/build/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/docker/fedora30/build/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/docker/fedora30/build/stop_build_shell.sh b/docker/fedora30/build/stop_build_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/docker/fedora30/build/stop_build_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + diff --git a/docker/fedora30/test/Dockerfile b/docker/fedora30/test/Dockerfile new file mode 100644 index 0000000..20a0749 --- /dev/null +++ b/docker/fedora30/test/Dockerfile @@ -0,0 +1,10 @@ +# Building an SCons Test image under Fedora 30 +FROM fedora:30 + +LABEL version="0.0.1" maintainer="Dirk Baechle " description="SCons Test image, based on a Fedora 30" + +# Install additional packages +RUN dnf -y install git bison cvs flex g++ gcc ghostscript m4 openssh-clients openssh-server python3-line_profiler python3-devel pypy3-devel rpm-build rcs java-1.8.0-openjdk swig texlive-scheme-basic texlive-base texlive-latex zip xterm vim vim-common nano + +CMD ["/bin/bash"] + diff --git a/docker/fedora30/test/build_image.sh b/docker/fedora30/test/build_image.sh new file mode 100755 index 0000000..5e1eaba --- /dev/null +++ b/docker/fedora30/test/build_image.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker build passing any other build options (command line options may override!) +docker build --network=host --file Dockerfile \ + -t scons-test-fedora30:latest -t scons-test-fedora30:0.0.1 "$@" . + +cd $OLD_WD + diff --git a/docker/fedora30/test/docker-compose.yml b/docker/fedora30/test/docker-compose.yml new file mode 100644 index 0000000..25daa18 --- /dev/null +++ b/docker/fedora30/test/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + build: + image: scons-test-fedora30:latest + restart: always + environment: + - DISPLAY + - HOME + volumes: + - /home:/home + - /tmp:/tmp + - /etc/sudoers:/etc/sudoers:ro + - /etc/passwd:/etc/passwd:ro + - /etc/shadow:/etc/shadow:ro + - /etc/group:/etc/group:ro + - ./startup:/startup + container_name: SCons_Test_Fedora30 + entrypoint: /startup/setup_container.sh + user: $DOCKERUID:$DOCKERGID + working_dir: $HOME + diff --git a/docker/fedora30/test/readme.rst b/docker/fedora30/test/readme.rst new file mode 100644 index 0000000..8cba2e9 --- /dev/null +++ b/docker/fedora30/test/readme.rst @@ -0,0 +1,43 @@ +======================= +Image for testing SCons +======================= + +This folder contains the files and scripts that can be used to +test SCons, based on a Fedora 30. + +Building the image +================== + +Build the local docker image by calling:: + + ./build_image.sh + +This will download the base image and install the required additional packages. + +Starting the image +================== + +Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call:: + + ./start_test_shell.sh + +which will open a new ``xterm`` with your current user on the host system as default. + +If you need additional setup steps or want to *mount* different folders to the test image, change the +files:: + + docker-compose.yml + ./startup/setup_container.sh + +locally. + + +Stopping the image +================== + +Simply call:: + + ./stop_test_shell.sh + +. + diff --git a/docker/fedora30/test/start_test_shell.sh b/docker/fedora30/test/start_test_shell.sh new file mode 100755 index 0000000..6905634 --- /dev/null +++ b/docker/fedora30/test/start_test_shell.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +xhost +local:docker +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose up -d + +cd $OLD_WD + diff --git a/docker/fedora30/test/startup/setup_container.sh b/docker/fedora30/test/startup/setup_container.sh new file mode 100755 index 0000000..f655441 --- /dev/null +++ b/docker/fedora30/test/startup/setup_container.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Here we can add local setup steps for the finishing touches to our Docker build container. +# This can be setting symbolic links, e.g. +# sudo ln -s /disk2/stuff /stuff +# or triggering further scripts. + +# We start a separate xterm/terminal, such that the container doesn't exit right away... +/usr/bin/xterm + diff --git a/docker/fedora30/test/stop_test_shell.sh b/docker/fedora30/test/stop_test_shell.sh new file mode 100755 index 0000000..c0a9707 --- /dev/null +++ b/docker/fedora30/test/stop_test_shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# store starting working directory +OLD_WD=$PWD + +# determine working directory of shell script +WD=$(dirname "$(readlink -f "$0")") + +cd $WD + +# call docker container with local user +export DOCKERUID=$(id -u) +export DOCKERGID=$(id -g) +docker-compose down + +cd $OLD_WD + -- cgit v0.12