Browse code

Label and streamline the remaining images

Clayton Coleman authored on 2016/02/14 07:57:06
Showing 21 changed files
... ...
@@ -8,14 +8,13 @@
8 8
 #
9 9
 FROM openshift/origin-base
10 10
 
11
-RUN yum install -y golang && yum clean all
12
-
13 11
 WORKDIR /go/src/github.com/openshift/origin
14
-ADD .   /go/src/github.com/openshift/origin
15
-ENV GOPATH /go
16
-ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin
12
+COPY . /go/src/github.com/openshift/origin
13
+ENV GOPATH=/go \
14
+    PATH=$PATH:$GOROOT/bin:$GOPATH/bin
17 15
 
18
-RUN go get github.com/openshift/origin && \
16
+RUN yum install -y golang && yum clean all && \
17
+    go get github.com/openshift/origin && \
19 18
     hack/build-go.sh && \
20 19
     cp _output/local/bin/linux/amd64/* /usr/bin/ && \
21 20
     mkdir -p /var/lib/origin
... ...
@@ -6,7 +6,7 @@
6 6
 FROM scratch
7 7
 
8 8
 MAINTAINER Clayton Coleman <ccoleman@redhat.com>
9
-ADD bin/deployment /deployment
9
+COPY bin/deployment /deployment
10 10
 
11 11
 EXPOSE 8080
12 12
 ENV COLOR="#006e9c"
... ...
@@ -6,7 +6,7 @@
6 6
 FROM scratch
7 7
 
8 8
 MAINTAINER Clayton Coleman <ccoleman@redhat.com>
9
-ADD bin/deployment /deployment
9
+COPY bin/deployment /deployment
10 10
 
11 11
 EXPOSE 8080
12 12
 ENV COLOR="#b5d4a8"
... ...
@@ -24,6 +24,6 @@ RUN mkdir -p /var/lib/etcd && chmod go+rwx /var/lib/etcd
24 24
 
25 25
 VOLUME ["/var/lib/etcd"]
26 26
 
27
-ADD etcd*.sh /usr/local/bin/
27
+COPY etcd*.sh /usr/local/bin/
28 28
 
29 29
 CMD ["/usr/local/bin/etcd.sh"]
... ...
@@ -5,14 +5,14 @@
5 5
 #
6 6
 FROM openshift/origin
7 7
 
8
-ADD bin/gitserver /usr/bin/gitserver
9
-ADD hooks/ /var/lib/git-hooks/
8
+COPY bin/gitserver /usr/bin/gitserver
9
+COPY hooks/ /var/lib/git-hooks/
10
+COPY gitconfig /var/lib/gitconfig/.gitconfig
10 11
 RUN mkdir -p /var/lib/git && \
11 12
     mkdir -p /var/lib/gitconfig && \
12 13
     chmod 777 /var/lib/gitconfig && \
13 14
     ln -s /usr/bin/gitserver /usr/bin/gitrepo-buildconfigs
14
-ADD gitconfig /var/lib/gitconfig/.gitconfig
15
-ENV HOME=/var/lib/gitconfig
16 15
 VOLUME /var/lib/git
16
+ENV HOME=/var/lib/gitconfig
17 17
 
18 18
 ENTRYPOINT ["/usr/bin/gitserver"]
... ...
@@ -1,5 +1,5 @@
1 1
 FROM scratch
2 2
 MAINTAINER Jessica Forrester <jforrest@redhat.com>
3
-ADD bin/hello-openshift /hello-openshift
3
+COPY bin/hello-openshift /hello-openshift
4 4
 EXPOSE 8080 8888
5 5
 ENTRYPOINT ["/hello-openshift"]
... ...
@@ -110,8 +110,6 @@ image openshift/origin-gitserver             examples/gitserver
110 110
 image openshift/origin-sti-builder           images/builder/docker/sti-builder
111 111
 image openshift/origin-f5-router             images/router/f5
112 112
 image openshift/node                         images/node
113
-# unpublished images
114
-image openshift/origin-custom-docker-builder images/builder/docker/custom-docker-builder
115 113
 
116 114
 # extra images (not part of infrastructure)
117 115
 image openshift/hello-openshift              examples/hello-openshift
... ...
@@ -1,19 +1,17 @@
1 1
 #
2 2
 # This is the base image from which all OpenShift Origin images inherit. Only packages
3
-# common to all downstream images should be here.
3
+# common to all downstream images should be here. Depends on Centos 7.2+
4 4
 #
5 5
 # The standard name for this image is openshift/origin-base
6 6
 #
7 7
 FROM centos:centos7
8 8
 
9
-# components from EPEL must be installed in a separate yum install step
10
-
11
-# TODO: systemd update from centos 7.1 -> 7.2 is broken, remove this once 7.2
12
-# base images land
13
-RUN yum swap -y -- remove systemd-container\* -- install systemd systemd-libs
14
-
15 9
 RUN INSTALL_PKGS="which git tar wget hostname sysvinit-tools util-linux bsdtar epel-release \
16
-        socat ethtool device-mapper iptables e2fsprogs xfsprogs" && \
10
+      socat ethtool device-mapper iptables tree findutils nc e2fsprogs xfsprogs" && \
17 11
     yum install -y $INSTALL_PKGS && \
18 12
     rpm -V $INSTALL_PKGS && \
19
-    yum clean all
13
+    yum clean all && \
14
+    mkdir -p /var/lib/origin
15
+
16
+LABEL io.k8s.display-name="OpenShift Origin Centos 7 Base" \
17
+      io.k8s.description="This is the base image from which all OpenShift Origin images inherit."
... ...
@@ -1,5 +1,5 @@
1 1
 #
2
-# This is the rhel7 base image from which all rhel7 based OpenShift Origin images
2
+# This is the rhel7 base image from which all rhel7 based Atomic OpenShift images
3 3
 # inherit. Only packages common to all downstream images should be here.
4 4
 #
5 5
 # The standard name for this image is openshift/ose-base
... ...
@@ -7,7 +7,11 @@
7 7
 FROM rhel7
8 8
 
9 9
 RUN INSTALL_PKGS="which git tar wget hostname sysvinit-tools util-linux bsdtar \
10
-    socat ethtool device-mapper iptables e2fsprogs xfsprogs" && \
10
+      socat ethtool device-mapper iptables tree findutils nc e2fsprogs xfsprogs" && \
11 11
     yum install -y $INSTALL_PKGS && \
12 12
     rpm -V $INSTALL_PKGS && \
13
-    yum clean all
13
+    yum clean all && \
14
+    mkdir -p /var/lib/origin
15
+
16
+LABEL io.k8s.display-name="Atomic OpenShift RHEL 7 Base" \
17
+      io.k8s.description="This is the base image from which all Atomic OpenShift images inherit."
... ...
@@ -9,7 +9,7 @@
9 9
 #   SOURCE_REF - a reference to pass to Git for which commit to use (optional)
10 10
 #
11 11
 # This image expects to have the Docker socket bind-mounted into the container.
12
-# If "/root/.dockercfg" is bind mounted in, it will use that as authorization 
12
+# If "/root/.dockercfg" is bind mounted in, it will use that as authorization
13 13
 # to a Docker registry.
14 14
 #
15 15
 # The standard name for this image is openshift/origin-custom-docker-builder
... ...
@@ -20,6 +20,9 @@ RUN INSTALL_PKGS="gettext automake make docker" && \
20 20
     yum install -y --enablerepo=centosplus $INSTALL_PKGS && \
21 21
     rpm -V $INSTALL_PKGS && \
22 22
     yum clean all
23
-ENV HOME /root
24
-ADD ./build.sh /tmp/build.sh
23
+
24
+LABEL io.k8s.display-name="OpenShift Origin Custom Builder Example" \
25
+      io.k8s.description="This is an example of a custom builder for use with OpenShift Origin."
26
+ENV HOME=/root
27
+COPY build.sh /tmp/build.sh
25 28
 CMD ["/tmp/build.sh"]
... ...
@@ -12,5 +12,6 @@
12 12
 #
13 13
 FROM openshift/origin
14 14
 
15
-ENV HOME /root
15
+LABEL io.k8s.display-name="OpenShift Origin Docker Builder" \
16
+      io.k8s.description="This is a component of OpenShift Origin and is responsible for executing Docker image builds."
16 17
 ENTRYPOINT ["/usr/bin/openshift-docker-build"]
... ...
@@ -1,5 +1,5 @@
1 1
 #
2
-# This is the image that executes a STI build inside Origin. It expects the
2
+# This is the image that executes a S2I build inside Origin. It expects the
3 3
 # following environment variables:
4 4
 #
5 5
 #   BUILD - JSON string containing the openshift build object
... ...
@@ -12,5 +12,6 @@
12 12
 #
13 13
 FROM openshift/origin
14 14
 
15
-ENV HOME /root
15
+LABEL io.k8s.display-name="OpenShift Origin S2I Builder" \
16
+      io.k8s.description="This is a component of OpenShift Origin and is responsible for executing source-to-image (s2i) image builds."
16 17
 ENTRYPOINT ["/usr/bin/openshift-sti-build"]
... ...
@@ -2,14 +2,18 @@
2 2
 # This is the default deployment strategy image for OpenShift Origin. It expects a set of
3 3
 # environment variables to parameterize the deploy:
4 4
 #
5
-#   KUBERNETES_MASTER - the address of the OpenShift master
6
-#   KUBERNETES_DEPLOYMENT_ID - the deployment identifier that is running this build
5
+#   "OPENSHIFT_DEPLOYMENT_NAME" - the name of a replication controller that is being deployed
6
+#   "OPENSHIFT_DEPLOYMENT_NAMESPACE" - the namespace of the replication controller that is being deployed
7
+#
8
+# It also expects to receive the standard Kubernetes service account secret to connect back to
9
+# the OpenShift API to drive the deployment.
7 10
 #
8 11
 # The standard name for this image is openshift/origin-deployer
9 12
 #
10 13
 FROM openshift/origin
11 14
 
12
-# The deployer doesn't require a privileged user.
15
+LABEL io.k8s.display-name="OpenShift Origin Deployer" \
16
+      io.k8s.description="This is a component of OpenShift Origin and executes the user deployment process to roll out new containers. It may be used as a base image for building your own custom deployer image."
17
+# The deployer doesn't require a root user.
13 18
 USER 1001
14
-
15 19
 ENTRYPOINT ["/usr/bin/openshift-deploy"]
... ...
@@ -1,9 +1,9 @@
1 1
 #
2
-# This image is used for running a host of an openshift dev cluster.
2
+# This image is used for running a host of an openshift dev cluster. This image is
3
+# a development support image and should not be used in production environments.
3 4
 #
4 5
 # The standard name for this image is openshift/dind
5 6
 #
6
-
7 7
 FROM fedora:23
8 8
 
9 9
 ## Configure systemd to run in a container
... ...
@@ -6,18 +6,16 @@
6 6
 #
7 7
 FROM openshift/origin-base
8 8
 
9
-RUN INSTALL_PKGS="tree findutils epel-release" && \
10
-    yum install -y $INSTALL_PKGS && \
11
-    rpm -V $INSTALL_PKGS && \
12
-    yum clean all
9
+COPY config.yml $REGISTRY_CONFIGURATION_PATH
10
+COPY bin/dockerregistry /dockerregistry
13 11
 
14
-# The registry doesn't require a privileged user.
15
-USER 1001
12
+LABEL io.k8s.display-name="OpenShift Origin Image Registry" \
13
+      io.k8s.description="This is a component of OpenShift Origin and exposes a Docker registry that is integrated with the cluster for authentication and management."
16 14
 
15
+# The registry doesn't require a root user.
16
+USER 1001
17 17
 EXPOSE 5000
18 18
 VOLUME /registry
19
-ENV REGISTRY_CONFIGURATION_PATH /config.yml
20
-CMD DOCKER_REGISTRY_URL=${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT} /dockerregistry ${REGISTRY_CONFIGURATION_PATH}
19
+ENV REGISTRY_CONFIGURATION_PATH=/config.yml
21 20
 
22
-ADD config.yml $REGISTRY_CONFIGURATION_PATH
23
-ADD bin/dockerregistry /dockerregistry
21
+CMD DOCKER_REGISTRY_URL=${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT} /dockerregistry ${REGISTRY_CONFIGURATION_PATH}
... ...
@@ -1,44 +1,33 @@
1 1
 #
2 2
 # This is an OpenShift Origin node image with integrated OpenvSwitch SDN
3
-# If you do not require OVS SDN you should just use the origin image
3
+# If you do not require OVS SDN use the openshift/origin image instead.
4
+#
5
+# This image expects to have a volume mounted at /etc/origin/node that contains
6
+# a KUBECONFIG file giving the node permission to talk to the master and a
7
+# node configuration file.
4 8
 #
5 9
 # The standard name for this image is openshift/node
6 10
 #
7
-
8 11
 FROM openshift/origin
9 12
 
10
-# Based on work by: Peter Schiffer <pschiffe@redhat.com>
11
-MAINTAINER Devan Goodwin <dgoodwin@redhat.com>
13
+COPY bin/* /usr/bin/
14
+COPY conf/openshift-sdn-ovs.conf /usr/lib/systemd/system/origin-node.service.d/
15
+COPY lib/systemd/system/docker.service.d/docker-sdn-ovs.conf /usr/lib/systemd/system/docker.service.d/docker-sdn-ovs.conf
16
+COPY scripts/* /usr/local/bin/
12 17
 
13
-# We need to install openvswitch for the client portions, the daemons are expected
14
-# to run in another container
15
-
16
-ADD https://copr.fedoraproject.org/coprs/maxamillion/origin-next/repo/epel-7/maxamillion-origin-next-epel-7.repo /etc/yum.repos.d/
17
-RUN INSTALL_PKGS="libmnl libnetfilter_conntrack openvswitch \
18
-    libnfnetlink iptables iproute bridge-utils procps-ng ethtool socat openssl \
19
-    binutils xz kmod-libs kmod sysvinit-tools device-mapper-libs dbus \
20
-    ceph-common iscsi-initiator-utils" && \
18
+RUN curl -L -o /etc/yum.repos.d/origin-next-epel-7.repo https://copr.fedoraproject.org/coprs/maxamillion/origin-next/repo/epel-7/maxamillion-origin-next-epel-7.repo && \
19
+    INSTALL_PKGS="libmnl libnetfilter_conntrack openvswitch \
20
+      libnfnetlink iptables iproute bridge-utils procps-ng ethtool socat openssl \
21
+      binutils xz kmod-libs kmod sysvinit-tools device-mapper-libs dbus \
22
+      ceph-common iscsi-initiator-utils" && \
21 23
     yum install -y $INSTALL_PKGS && \
22 24
     rpm -V $INSTALL_PKGS && \
23
-    yum clean all
24
-
25
-RUN mkdir -p \
26
-    /usr/lib/systemd/system/origin-node.service.d \
27
-    /usr/lib/systemd/system/docker.service.d
28
-
29
-# All of the following are placed in images/node by hack/build-images.sh
30
-# They won't exist in the git checkout
31
-ADD bin/* /usr/bin/
32
-ADD conf/openshift-sdn-ovs.conf /usr/lib/systemd/system/origin-node.service.d/
33
-ADD lib/systemd/system/docker.service.d/docker-sdn-ovs.conf /usr/lib/systemd/system/docker.service.d/docker-sdn-ovs.conf
34
-ADD scripts/* /usr/local/bin/
35
-RUN chmod +x /usr/local/bin/* /usr/bin/openshift-*
36
-
37
-VOLUME [ "/etc/origin/node", "/var/lib/origin" ]
38
-WORKDIR /var/lib/origin
39
-
40
-ENV HOME /root
41
-ENV OPENSHIFT_CONTAINERIZED true
42
-ENV KUBECONFIG /etc/origin/node/node.kubeconfig
43
-ENTRYPOINT []
44
-CMD [ "/usr/local/bin/origin-node-run.sh" ]
25
+    yum clean all && \
26
+    mkdir -p /usr/lib/systemd/system/origin-node.service.d /usr/lib/systemd/system/docker.service.d && \
27
+    chmod +x /usr/local/bin/* /usr/bin/openshift-*
28
+
29
+LABEL io.k8s.display-name="OpenShift Origin Node" \
30
+      io.k8s.description="This is a component of OpenShift Origin and contains the software for individual nodes when using SDN."
31
+VOLUME /etc/origin/node
32
+ENV KUBECONFIG=/etc/origin/node/node.kubeconfig
33
+ENTRYPOINT [ "/usr/local/bin/origin-node-run.sh" ]
... ...
@@ -2,21 +2,16 @@
2 2
 
3 3
 set -eu
4 4
 
5
+hostetc=${HOST_ETC:-/rootfs/etc}
5 6
 conf=${CONFIG_FILE:-/etc/origin/node/node-config.yaml}
6 7
 opts=${OPTIONS:---loglevel=2}
7
-
8
-function quit {
9
-    pkill -g 0 openshift
10
-    exit 0
11
-}
12
-
13
-trap quit SIGTERM
14
-
15
-if [ ! -f ${HOST_ETC}/systemd/system/docker.service.d/docker-sdn-ovs.conf ]; then
16
-    mkdir -p ${HOST_ETC}/systemd/system/docker.service.d
17
-    cp /usr/lib/systemd/system/docker.service.d/docker-sdn-ovs.conf ${HOST_ETC}/systemd/system/docker.service.d
8
+if [ "$#" -ne 0 ]; then
9
+  opts=""
18 10
 fi
19 11
 
20
-/usr/bin/openshift start node "--config=${conf}" "${opts}" &
12
+if [ ! -f ${hostetc}/systemd/system/docker.service.d/docker-sdn-ovs.conf ]; then
13
+    mkdir -p ${hostetc}/systemd/system/docker.service.d
14
+    cp /usr/lib/systemd/system/docker.service.d/docker-sdn-ovs.conf ${hostetc}/systemd/system/docker.service.d
15
+fi
21 16
 
22
-while true; do sleep 5; done
17
+exec /usr/bin/openshift start node "--config=${conf}" "${opts}" $@
... ...
@@ -3,25 +3,19 @@
3 3
 #
4 4
 # The standard name for this image is openshift/openvswitch
5 5
 #
6
-
7 6
 FROM centos:centos7
8 7
 
9
-MAINTAINER Scott Dodson <sdodson@redhat.com>
10
-
11
-ADD https://copr.fedoraproject.org/coprs/maxamillion/origin-next/repo/epel-7/maxamillion-origin-next-epel-7.repo /etc/yum.repos.d/
8
+COPY scripts/* /usr/local/bin/
12 9
 
13
-# TODO: systemd update from centos 7.1 -> 7.2 is broken, remove this once 7.2
14
-# base images land
15
-RUN yum swap -y -- remove systemd-container\* -- install systemd systemd-libs
16
-
17
-RUN INSTALL_PKGS="openvswitch" && \
10
+RUN curl -L -o /etc/yum.repos.d/origin-next-epel-7.repo https://copr.fedoraproject.org/coprs/maxamillion/origin-next/repo/epel-7/maxamillion-origin-next-epel-7.repo && \
11
+    INSTALL_PKGS="openvswitch" && \
18 12
     yum install -y $INSTALL_PKGS && \
19 13
     rpm -V $INSTALL_PKGS && \
20
-    yum clean all
21
-
22
-ADD  scripts/* /usr/local/bin/
23
-RUN chmod +x /usr/local/bin/*
24
-VOLUME [ "/etc/openswitch" ]
14
+    yum clean all && \
15
+    chmod +x /usr/local/bin/*
25 16
 
17
+LABEL io.k8s.display-name="OpenShift Origin OpenVSwitch Daemon" \
18
+      io.k8s.description="This is a component of OpenShift Origin and runs an OpenVSwitch daemon process."
19
+VOLUME /etc/openswitch
26 20
 ENV HOME /root
27
-ENTRYPOINT [ "/usr/local/bin/ovs-run.sh" ]
21
+ENTRYPOINT ["/usr/local/bin/ovs-run.sh"]
... ...
@@ -10,23 +10,25 @@
10 10
 #
11 11
 FROM openshift/origin-base
12 12
 
13
-RUN mkdir -p /var/lib/origin
14
-
15
-ADD bin/openshift /usr/bin/openshift
13
+COPY bin/openshift /usr/bin/openshift
16 14
 RUN ln -s /usr/bin/openshift /usr/bin/oc && \
17 15
     ln -s /usr/bin/openshift /usr/bin/oadm && \
18
-    ln -s /usr/bin/openshift /usr/bin/osc && \
19
-    ln -s /usr/bin/openshift /usr/bin/osadm && \
16
+    ln -s /usr/bin/openshift /usr/bin/origin && \
20 17
     ln -s /usr/bin/openshift /usr/bin/kubectl && \
21 18
     ln -s /usr/bin/openshift /usr/bin/openshift-deploy && \
19
+    ln -s /usr/bin/openshift /usr/bin/openshift-recycle && \
20
+    ln -s /usr/bin/openshift /usr/bin/openshift-router && \
22 21
     ln -s /usr/bin/openshift /usr/bin/openshift-docker-build && \
23 22
     ln -s /usr/bin/openshift /usr/bin/openshift-sti-build && \
24 23
     ln -s /usr/bin/openshift /usr/bin/openshift-f5-router && \
25 24
     setcap 'cap_net_bind_service=ep' /usr/bin/openshift
26 25
 
27
-ENV HOME /root
28
-ENV OPENSHIFT_CONTAINERIZED true
29
-ENV KUBECONFIG /var/lib/origin/openshift.local.config/master/admin.kubeconfig
26
+LABEL io.k8s.display-name="OpenShift Origin Application Platform" \
27
+      io.k8s.description="OpenShift Origin is a platform for developing, building, and deploying containerized applications. See https://docs.openshift.org/latest for more on running OpenShift Origin."
28
+ENV HOME=/root \
29
+    OPENSHIFT_CONTAINERIZED=true \
30
+    KUBECONFIG=/var/lib/origin/openshift.local.config/master/admin.kubeconfig
31
+VOLUME /var/lib/origin
30 32
 WORKDIR /var/lib/origin
31 33
 EXPOSE 8443 53
32 34
 ENTRYPOINT ["/usr/bin/openshift"]
... ...
@@ -8,6 +8,9 @@
8 8
 #
9 9
 FROM scratch
10 10
 
11
-ADD bin/pod /pod
11
+COPY bin/pod /pod
12 12
 
13
+USER 1001
14
+LABEL io.k8s.display-name="OpenShift Origin Pod Infrastructure" \
15
+      io.k8s.description="This is a component of OpenShift Origin and holds on to the shared Linux namespaces within a Pod."
13 16
 ENTRYPOINT ["/pod"]
... ...
@@ -23,10 +23,12 @@ RUN mkdir $TMPDIR && \
23 23
     go get golang.org/x/tools/cmd/cover github.com/tools/godep github.com/golang/lint/golint && \
24 24
     touch /os-build-image
25 25
 
26
-WORKDIR /go/src/github.com/openshift/origin
27
-
28 26
 # Allows building Origin sources mounted using volume
29
-ADD openshift-origin-build.sh /usr/bin/openshift-origin-build.sh
27
+COPY openshift-origin-build.sh /usr/bin/openshift-origin-build.sh
28
+
29
+WORKDIR /go/src/github.com/openshift/origin
30
+LABEL io.k8s.display-name="OpenShift Origin Release Environment" \
31
+      io.k8s.description="This is the standard release image for OpenShift Origin and contains the necessary build tools to build the platform."
30 32
 
31 33
 # Expect a tar with the source of OpenShift Origin (and /os-version-defs in the root)
32
-CMD tar mxzf - && hack/build-cross.sh
34
+CMD bsdtar mxzf - && hack/build-cross.sh