Skip to content

Commit 8a42ffb

Browse files
committed
group updates to public branch
1 parent 9b5252f commit 8a42ffb

3 files changed

Lines changed: 111 additions & 35 deletions

File tree

.jenkins/docker-build-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
pipeline:
33
alwaysEmailList: ljohnson@dettonville.org
4-
logLevel: DEBUG
54
runGroupsInParallel: false
5+
parallelJobsBatchSize: 4
66
runInParallel: true
77
failFast: true
88
timeout: 5

systemd/centos/9.Dockerfile

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,50 @@
11
## ref: https://schneide.blog/2019/10/21/using-parameterized-docker-builds/
22
## https://pythonspeed.com/articles/multi-stage-docker-python/
33
## ref: https://www.server-world.info/en/note?os=CentOS_Stream_9&p=docker&f=1
4-
4+
ARG BASEOS_DIGEST
55
#FROM centos:9
6-
FROM quay.io/centos/centos:stream9
6+
#FROM quay.io/centos/centos:stream9
7+
FROM quay.io/centos/centos:stream9${BASEOS_DIGEST:-}
78

89
ARG BUILD_DATE
910
ARG BUILD_ID=devel
1011
LABEL build=$BUILD_ID
1112

1213
ENV container=docker
1314

14-
## Install systemd
15-
## ref: https://linuxopsys.com/topics/install-systemd
16-
RUN yum groupinstall -y "Development Tools" && \
17-
dnf install -y \
18-
libcap-devel \
19-
gperf \
20-
glib2-devel \
21-
jq \
15+
RUN yum -y update \
16+
&& yum -y install \
17+
epel-release \
18+
hostname \
19+
initscripts \
20+
iproute \
21+
openssl \
22+
sudo \
2223
which \
23-
python3-pip
24-
25-
## use --global option instead
26-
#ENV PIPX_HOME="/opt/pipx"
27-
#ENV PIPX_BIN_DIR="/usr/local/bin"
24+
jq \
25+
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man \
26+
&& yum clean all
27+
28+
# selectively remove systemd targets -- See https://hub.docker.com/_/centos/
29+
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
30+
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
31+
rm -f /lib/systemd/system/multi-user.target.wants/*;\
32+
rm -f /etc/systemd/system/*.wants/*;\
33+
rm -f /lib/systemd/system/local-fs.target.wants/*; \
34+
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
35+
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
36+
rm -f /lib/systemd/system/basic.target.wants/*;\
37+
rm -f /lib/systemd/system/anaconda.target.wants/*;
38+
39+
# hotfix for issue #49
40+
RUN chmod 0400 /etc/shadow
2841

2942
## not necessary since /usr/local/bin is already in the PATH
3043
#ENV PATH="${PIPX_BIN_DIR}:${PATH}"
3144
RUN echo "PATH: ${PATH}"
3245
RUN echo "export PATH=$PATH" >> /etc/profile
3346
ENV PATH="/root/.local/bin:${PATH}"
3447

35-
## ref: https://pipx.pypa.io/stable/installation/
36-
RUN python3 -m pip install --user pipx jinja2
37-
38-
## not necessary since /usr/local/bin is already in PATH
39-
#RUN pipx ensurepath --global
40-
#RUN python3 -m pipx ensurepath
41-
42-
#RUN pip install meson ninja jinja2
43-
## ref: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3
44-
## ref: https://github.com/pypa/pipx/issues/754#issuecomment-951162846
45-
RUN pipx install --global meson ninja
46-
#RUN python3 -m pipx install --global meson ninja
47-
48-
## Install systemd
49-
## ref: https://linuxopsys.com/topics/install-systemd
50-
## ref: https://stackoverflow.com/questions/48098671/build-with-docker-and-privileged#57077772
51-
COPY ./install-systemd.sh /var/tmp/
52-
RUN bash -x /var/tmp/install-systemd.sh
53-
5448
RUN systemctl set-default multi-user.target
5549

5650
# The machine-id should be generated when creating the container. This will be

systemd/centos/9.src.Dockerfile

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## ref: https://schneide.blog/2019/10/21/using-parameterized-docker-builds/
2+
## https://pythonspeed.com/articles/multi-stage-docker-python/
3+
## ref: https://www.server-world.info/en/note?os=CentOS_Stream_9&p=docker&f=1
4+
5+
#FROM centos:9
6+
FROM quay.io/centos/centos:stream9
7+
8+
ARG BUILD_DATE
9+
ARG BUILD_ID=devel
10+
LABEL build=$BUILD_ID
11+
12+
ENV container=docker
13+
14+
## Install systemd
15+
## ref: https://linuxopsys.com/topics/install-systemd
16+
RUN yum groupinstall -y "Development Tools" && \
17+
dnf install -y \
18+
libcap-devel \
19+
gperf \
20+
glib2-devel \
21+
jq \
22+
which \
23+
python3-pip
24+
25+
## use --global option instead
26+
#ENV PIPX_HOME="/opt/pipx"
27+
#ENV PIPX_BIN_DIR="/usr/local/bin"
28+
29+
## not necessary since /usr/local/bin is already in the PATH
30+
#ENV PATH="${PIPX_BIN_DIR}:${PATH}"
31+
RUN echo "PATH: ${PATH}"
32+
RUN echo "export PATH=$PATH" >> /etc/profile
33+
ENV PATH="/root/.local/bin:${PATH}"
34+
35+
## ref: https://pipx.pypa.io/stable/installation/
36+
RUN python3 -m pip install --user pipx jinja2
37+
38+
## not necessary since /usr/local/bin is already in PATH
39+
#RUN pipx ensurepath --global
40+
#RUN python3 -m pipx ensurepath
41+
42+
#RUN pip install meson ninja jinja2
43+
## ref: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3
44+
## ref: https://github.com/pypa/pipx/issues/754#issuecomment-951162846
45+
RUN pipx install --global meson ninja
46+
#RUN python3 -m pipx install --global meson ninja
47+
48+
## Install systemd
49+
## ref: https://linuxopsys.com/topics/install-systemd
50+
## ref: https://stackoverflow.com/questions/48098671/build-with-docker-and-privileged#57077772
51+
COPY ./install-systemd.sh /var/tmp/
52+
RUN bash -x /var/tmp/install-systemd.sh
53+
54+
RUN systemctl set-default multi-user.target
55+
56+
# The machine-id should be generated when creating the container. This will be
57+
# done automatically if the file is not present, so let's delete it.
58+
RUN rm -f \
59+
/etc/machine-id \
60+
/var/lib/dbus/machine-id
61+
62+
RUN echo "alias ll='ls -Fla'" >> ~/.bashrc
63+
RUN echo "alias la='ls -alrt'" >> ~/.bashrc
64+
65+
# The host's cgroup filesystem need's to be mounted (read-only) in the
66+
# container. '/run', '/run/lock' and '/tmp' need to be tmpfs filesystems when
67+
# running the container without 'CAP_SYS_ADMIN'.
68+
#
69+
# NOTE: For running Debian stretch, 'CAP_SYS_ADMIN' still needs to be added, as
70+
# stretch's version of systemd is not recent enough. Buster will run just
71+
# fine without 'CAP_SYS_ADMIN'.
72+
#VOLUME [ "/sys/fs/cgroup" ]
73+
VOLUME ["/sys/fs/cgroup", "/tmp", "/run"]
74+
75+
# A different stop signal is required, so systemd will initiate a shutdown when
76+
# running 'docker stop <container>'.
77+
STOPSIGNAL SIGRTMIN+3
78+
79+
## ref: https://unix.stackexchange.com/questions/276340/linux-command-systemctl-status-is-not-working-inside-a-docker-container
80+
CMD ["/sbin/init"]
81+
#CMD ["/usr/sbin/init"]
82+
#CMD ["/usr/lib/systemd/systemd"]

0 commit comments

Comments
 (0)