Skip to content

Commit 0223d51

Browse files
authored
Merge pull request #3691 from dirkbaechle/issue3585-docker-files
Issue3585 Add Docker files for Ubuntu 19.10 and Fedora 32
2 parents ab8a9c5 + 3666516 commit 0223d51

30 files changed

+662
-0
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ NOTE: Please include a reference to any Issues resolved by your changes in the b
1010

1111
RELEASE VERSION/DATE TO BE FILLED IN LATER
1212

13+
From Dirk Baechle:
14+
- Added Docker images for building and testing SCons. (issue #3585)
15+
1316
From James Benton:
1417
- Improve Visual Studio solution/project generation code to add support
1518
for a per-variant cppflags. Intellisense can be affected by cppflags,

testing/docker/docker.rst

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
==================================
2+
Basic working with docker registry
3+
==================================
4+
5+
Install required packages
6+
=========================
7+
8+
Ensure that the following packages are installed on your local machine::
9+
10+
docker.io >= v18.09
11+
docker-compose >= v1.17
12+
13+
User and group
14+
==============
15+
16+
Add your local user to the `docker` group, e.g. by::
17+
18+
sudo usermod -aG docker ${USER}
19+
20+
. After this step logout and login again, so that the change has been applied and the new group
21+
is in effect.
22+
23+
24+
Configuring docker daemon
25+
=========================
26+
27+
Reconfigure by editing `/etc/docker/daemon.json` as *root*::
28+
29+
{
30+
"debug": false
31+
}
32+
33+
.
34+
35+
Then reboot the machine or simply restart the daemon as *root* with::
36+
37+
sudo systemctl restart docker.service
38+
39+
To check that the docker daemon was configured correctly, do a::
40+
41+
docker info
42+
43+
which should result in an output similar to::
44+
45+
Client:
46+
Debug Mode: false
47+
48+
Server:
49+
Containers: 0
50+
Running: 0
51+
Paused: 0
52+
Stopped: 0
53+
Images: 0
54+
Server Version: 19.03.6
55+
Storage Driver: overlay2
56+
Backing Filesystem: extfs
57+
Supports d_type: true
58+
Native Overlay Diff: true
59+
Logging Driver: json-file
60+
Cgroup Driver: cgroupfs
61+
Plugins:
62+
Volume: local
63+
Network: bridge host ipvlan macvlan null overlay
64+
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
65+
Swarm: inactive
66+
Runtimes: runc
67+
Default Runtime: runc
68+
Init Binary: docker-init
69+
containerd version:
70+
runc version:
71+
init version:
72+
Security Options:
73+
apparmor
74+
seccomp
75+
Profile: default
76+
Kernel Version: 4.15.0-88-generic
77+
Operating System: Ubuntu 18.04.4 LTS
78+
OSType: linux
79+
Architecture: x86_64
80+
CPUs: 4
81+
Total Memory: 6.997GiB
82+
Name: ubuntu
83+
ID: H2N5:VOZ6:UO6V:B36O:MD6Q:7GXR:M4QY:7EBB:NC6R:HQCQ:7ARF:CZBH
84+
Docker Root Dir: /var/lib/docker
85+
Debug Mode: false
86+
Registry: https://index.docker.io/v1/
87+
Labels:
88+
Experimental: false
89+
Insecure Registries:
90+
127.0.0.0/8
91+
Live Restore Enabled: false
92+
93+
WARNING: No swap limit support
94+
95+
Setup resolv.conf if necessary
96+
===============================
97+
98+
Docker uses `etc/resolv.conf` DNS information and passes that automatically to containers. If the file is not configured
99+
properly or if entries are not valid, the server adds automatically public Google DNS nameservers
100+
(8.8.8.8 and 8.8.4.4) to the container's DNS configuration.
101+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Building an SCons Release Build image under Fedora 32
2+
FROM fedora:32
3+
4+
LABEL version="0.0.1" maintainer="Dirk Baechle <[email protected]>" description="SCons Release Build, based on a Fedora 32"
5+
6+
# Install additional packages
7+
RUN dnf -y install git python3-lxml fop fontbox python3-devel lynx xterm vim vim-common nano unzip
8+
9+
# Install hyphenation patterns for FOP
10+
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/
11+
12+
# Epydoc can be installed via pip3, but it doesn't seem to work properly.
13+
# For the moment we don't install it and might replace it with Sphinx later...
14+
# RUN dnf -y install python3-pip && pip3 install epydoc
15+
16+
CMD ["/bin/bash"]
17+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# store starting working directory
4+
OLD_WD=$PWD
5+
6+
# determine working directory of shell script
7+
WD=$(dirname "$(readlink -f "$0")")
8+
9+
cd $WD
10+
11+
# call docker build passing any other build options (command line options may override!)
12+
docker build --network=host --file Dockerfile \
13+
-t scons-build-fedora32:latest -t scons-build-fedora32:0.0.1 "$@" .
14+
15+
cd $OLD_WD
16+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3'
2+
3+
services:
4+
build:
5+
image: scons-build-fedora32:latest
6+
restart: always
7+
environment:
8+
- DISPLAY
9+
- HOME
10+
volumes:
11+
- /home:/home
12+
- /tmp:/tmp
13+
- /etc/sudoers:/etc/sudoers:ro
14+
- /etc/passwd:/etc/passwd:ro
15+
- /etc/shadow:/etc/shadow:ro
16+
- /etc/group:/etc/group:ro
17+
- ./startup:/startup
18+
container_name: SCons_Build_Fedora32
19+
entrypoint: /startup/setup_container.sh
20+
user: $DOCKERUID:$DOCKERGID
21+
working_dir: $HOME
22+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
==================================
2+
Image for building/releasing SCons
3+
==================================
4+
5+
This folder contains the files and scripts that can be used to
6+
build and release SCons, based on a Fedora 32.
7+
8+
Building the image
9+
==================
10+
11+
Build the local docker image by calling::
12+
13+
./build_image.sh
14+
15+
This will download the base image and install the required additional packages.
16+
17+
Starting the image
18+
==================
19+
20+
Is done via ``docker-compose`` so make sure you have this package installed in your host system. Then call::
21+
22+
./start_build_shell.sh
23+
24+
which will open a new ``xterm`` with your current user on the host system as default.
25+
26+
If you need additional setup steps or want to *mount* different folders to the build image, change the
27+
files::
28+
29+
docker-compose.yml
30+
./startup/setup_container.sh
31+
32+
locally.
33+
34+
35+
Stopping the image
36+
==================
37+
38+
Simply call::
39+
40+
./stop_build_shell.sh
41+
42+
.
43+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# store starting working directory
4+
OLD_WD=$PWD
5+
6+
# determine working directory of shell script
7+
WD=$(dirname "$(readlink -f "$0")")
8+
9+
cd $WD
10+
11+
# call docker container with local user
12+
xhost +local:docker
13+
export DOCKERUID=$(id -u)
14+
export DOCKERGID=$(id -g)
15+
docker-compose up -d
16+
17+
cd $OLD_WD
18+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# Here we can add local setup steps for the finishing touches to our Docker build container.
4+
# This can be setting symbolic links, e.g.
5+
# sudo ln -s /disk2/stuff /stuff
6+
# or triggering further scripts.
7+
8+
# We start a separate xterm/terminal, such that the container doesn't exit right away...
9+
/usr/bin/xterm
10+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# store starting working directory
4+
OLD_WD=$PWD
5+
6+
# determine working directory of shell script
7+
WD=$(dirname "$(readlink -f "$0")")
8+
9+
cd $WD
10+
11+
# call docker container with local user
12+
export DOCKERUID=$(id -u)
13+
export DOCKERGID=$(id -g)
14+
docker-compose down
15+
16+
cd $OLD_WD
17+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Building an SCons Test image under Fedora 32
2+
FROM fedora:32
3+
4+
LABEL version="0.0.1" maintainer="Dirk Baechle <[email protected]>" description="SCons Test image, based on a Fedora 32"
5+
6+
# Install additional packages
7+
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
8+
9+
CMD ["/bin/bash"]
10+

0 commit comments

Comments
 (0)