Skip to content

Commit

Permalink
Move dependencies out of the base image and into children
Browse files Browse the repository at this point in the history
Reduces the size of the base image. RPMs explicitly list all their
dependencies to prevent accidental removal.
  • Loading branch information
smarterclayton committed May 2, 2018
1 parent 57e7c6c commit 4333db3
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 25 deletions.
7 changes: 2 additions & 5 deletions images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ FROM openshift/origin-source

COPY *.repo /etc/yum.repos.d/
RUN INSTALL_PKGS=" \
which git tar wget hostname sysvinit-tools util-linux bsdtar \
socat ethtool device-mapper iptables tree findutils nmap-ncat e2fsprogs \
xfsprogs lsof device-mapper-persistent-data ceph-common \
which tar wget hostname sysvinit-tools util-linux \
socat tree findutils lsof bind-utils \
" && \
yum install -y centos-release-ceph-luminous && \
rpm -V centos-release-ceph-luminous && \
yum install -y ${INSTALL_PKGS} && \
rpm -V ${INSTALL_PKGS} && \
yum clean all && \
Expand Down
7 changes: 2 additions & 5 deletions images/base/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
FROM openshift/origin-source

RUN INSTALL_PKGS=" \
which git tar wget hostname sysvinit-tools util-linux bsdtar \
socat ethtool device-mapper iptables tree findutils nmap-ncat e2fsprogs \
xfsprogs lsof device-mapper-persistent-data ceph-common \
which tar wget hostname sysvinit-tools util-linux \
socat tree findutils lsof bind-utils \
" && \
yum install -y centos-release-ceph-luminous && \
rpm -V centos-release-ceph-luminous && \
yum install -y ${INSTALL_PKGS} && \
rpm -V ${INSTALL_PKGS} && \
yum clean all && \
Expand Down
5 changes: 2 additions & 3 deletions images/base/Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
FROM rhel7

RUN INSTALL_PKGS=" \
which git tar wget hostname sysvinit-tools util-linux bsdtar \
socat ethtool device-mapper iptables tree findutils nmap-ncat e2fsprogs \
xfsprogs lsof device-mapper-persistent-data ceph-common \
which tar wget hostname sysvinit-tools util-linux \
socat tree findutils lsof bind-utils \
" && \
yum --disablerepo=origin-local-release install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
Expand Down
13 changes: 11 additions & 2 deletions images/builder/docker/docker-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@
#
FROM openshift/origin-control-plane

LABEL io.k8s.display-name="OpenShift Origin Docker Builder" \
io.k8s.description="This is a component of OpenShift Origin and is responsible for executing Docker image builds." \
RUN INSTALL_PKGS=" \
which tar wget hostname sysvinit-tools util-linux \
socat tree findutils lsof bind-utils \
git tar bsdtar \
" && \
yum install -y ${INSTALL_PKGS} && \
rpm -V ${INSTALL_PKGS} && \
yum clean all

LABEL io.k8s.display-name="OpenShift Origin Builder" \
io.k8s.description="This is a component of OpenShift Origin and is responsible for executing image builds." \
io.openshift.tags="openshift,builder"
ENTRYPOINT ["/usr/bin/openshift-docker-build"]
13 changes: 10 additions & 3 deletions images/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ COPY scripts/* /usr/local/bin/
COPY system-container/system-container-wrapper.sh /usr/local/bin/
COPY system-container/manifest.json system-container/config.json.template system-container/service.template system-container/tmpfiles.template /exports/

RUN INSTALL_PKGS="origin-sdn-ovs libmnl libnetfilter_conntrack conntrack-tools \
RUN INSTALL_PKGS=" \
socat ethtool device-mapper iptables nmap-ncat e2fsprogs \
xfsprogs device-mapper-persistent-data ceph-common \
origin-sdn-ovs libmnl libnetfilter_conntrack conntrack-tools \
libnfnetlink iptables iproute bridge-utils procps-ng ethtool socat openssl \
binutils xz kmod-libs kmod sysvinit-tools device-mapper-libs dbus \
iscsi-initiator-utils bind-utils" && \
iscsi-initiator-utils bind-utils \
" && \
yum install -y centos-release-ceph-luminous && \
rpm -V centos-release-ceph-luminous && \
yum --enablerepo=origin-local-release install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all
Expand All @@ -25,6 +31,7 @@ LABEL io.k8s.display-name="OpenShift Origin Node" \
io.k8s.description="This is a component of OpenShift Origin and contains the software for individual nodes when using SDN." \
io.openshift.tags="openshift,node"

ENV KUBECONFIG=/etc/origin/node/node.kubeconfig
ENV OPENSHIFT_CONTAINERIZED=true \
KUBECONFIG=/etc/origin/node/node.kubeconfig

ENTRYPOINT [ "/usr/local/bin/origin-node-run.sh" ]
13 changes: 10 additions & 3 deletions images/node/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ COPY scripts/* /usr/local/bin/
COPY system-container/system-container-wrapper.sh /usr/local/bin/
COPY system-container/manifest.json system-container/config.json.template system-container/service.template system-container/tmpfiles.template /exports/

RUN INSTALL_PKGS="origin-sdn-ovs libmnl libnetfilter_conntrack conntrack-tools \
RUN INSTALL_PKGS=" \
socat ethtool device-mapper iptables nmap-ncat e2fsprogs \
xfsprogs device-mapper-persistent-data ceph-common \
origin-sdn-ovs libmnl libnetfilter_conntrack conntrack-tools \
libnfnetlink iptables iproute bridge-utils procps-ng ethtool socat openssl \
binutils xz kmod-libs kmod sysvinit-tools device-mapper-libs dbus \
iscsi-initiator-utils bind-utils" && \
iscsi-initiator-utils bind-utils \
" && \
yum install -y centos-release-ceph-luminous && \
rpm -V centos-release-ceph-luminous && \
yum --enablerepo=origin-local-release install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all
Expand All @@ -21,6 +27,7 @@ LABEL io.k8s.display-name="OpenShift Origin Node" \
io.k8s.description="This is a component of OpenShift Origin and contains the software for individual nodes when using SDN." \
io.openshift.tags="openshift,node"

ENV KUBECONFIG=/etc/origin/node/node.kubeconfig
ENV OPENSHIFT_CONTAINERIZED=true \
KUBECONFIG=/etc/origin/node/node.kubeconfig

ENTRYPOINT [ "/usr/local/bin/origin-node-run.sh" ]
1 change: 0 additions & 1 deletion images/origin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ LABEL io.k8s.display-name="OpenShift Origin Application Platform" \
io.openshift.tags="openshift,core"

ENV HOME=/root \
OPENSHIFT_CONTAINERIZED=true \
KUBECONFIG=/var/lib/origin/openshift.local.config/master/admin.kubeconfig

WORKDIR /var/lib/origin
Expand Down
1 change: 0 additions & 1 deletion images/origin/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ LABEL io.k8s.display-name="OpenShift Origin Application Platform" \
io.openshift.tags="openshift,core"

ENV HOME=/root \
OPENSHIFT_CONTAINERIZED=true \
KUBECONFIG=/var/lib/origin/openshift.local.config/master/admin.kubeconfig

WORKDIR /var/lib/origin
Expand Down
2 changes: 1 addition & 1 deletion test/extended/testdata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/extended/testdata/router-http-echo-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ items:
deploymentconfig: router-http-echo
spec:
containers:
- image: openshift/origin-base
- image: openshift/origin-node
name: router-http-echo
command:
- /usr/bin/socat
Expand Down

0 comments on commit 4333db3

Please sign in to comment.