packaging: Add Dockerfile for CentOS 7 packaging with base image

Signed-off-by: Till Maas <opensource@till.name>
This commit is contained in:
Till Maas 2019-01-21 15:23:20 +01:00 committed by Gris Ge
parent dd876977e5
commit 620086d0cd
4 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,15 @@
FROM nmstate/centos7-nmstate-base
ARG SOURCE_COMMIT
RUN yum -y install \
python2-pip \
git \
&& \
yum clean all
RUN pip install git+https://github.com/nmstate/nmstate@${SOURCE_COMMIT:-master}
VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"]

View File

@ -0,0 +1,30 @@
# This Dockerfile is based on the recommendations provided in the
# Centos official repository (https://hub.docker.com/_/centos/).
# It enables systemd to be operational.
FROM centos:7.5.1804
ENV container docker
COPY docker_enable_systemd.sh docker_sys_config.sh ./
RUN bash ./docker_enable_systemd.sh && rm ./docker_enable_systemd.sh -f
# libibverbs is a dependency for openvswitch that is missing as a dependency in the RPM
RUN yum -y upgrade && \
yum -y install \
libibverbs \
NetworkManager \
NetworkManager-libnm \
NetworkManager-ovs \
openvswitch \
&& \
yum -y install epel-release && \
yum -y install \\
python2-pyyaml \
python2-six \
python-gobject-base \
python-jsonschema \
python-setuptools \
&& \
yum clean all && \
bash ./docker_sys_config.sh && rm ./docker_sys_config -f

View File

@ -0,0 +1,11 @@
cd /lib/systemd/system/sysinit.target.wants/;
for i in *; do
[ $i == systemd-tmpfiles-setup.service ] || rm -f $i;
done;
rm -f /lib/systemd/system/multi-user.target.wants/*;
rm -f /etc/systemd/system/*.wants/*;
rm -f /lib/systemd/system/local-fs.target.wants/*;
rm -f /lib/systemd/system/sockets.target.wants/*udev*;
rm -f /lib/systemd/system/sockets.target.wants/*initctl*;
rm -f /lib/systemd/system/basic.target.wants/*;
rm -f /lib/systemd/system/anaconda.target.wants/*;

View File

@ -0,0 +1,10 @@
install -o root -g root -d /etc/sysconfig/network-scripts
echo -e "[logging]\nlevel=TRACE\ndomains=ALL\n" > \
/etc/NetworkManager/conf.d/97-docker-build.conf
echo -e "[device]\nmatch-device=*\nmanaged=0\n" >> \
/etc/NetworkManager/conf.d/97-docker-build.conf
sed -i 's/#RateLimitInterval=30s/RateLimitInterval=0/' \
/etc/systemd/journald.conf
sed -i 's/#RateLimitBurst=1000/RateLimitBurst=0/' \
/etc/systemd/journald.conf
systemctl enable openvswitch.service