kuryr-kubernetes/controller.Dockerfile
Michał Dulko 139b912365 Upgrade centos in dockerfiles
Somehow an update to centos repos and the fact that docker.io centos
containers weren't updated for a while broke us. To fix this we need to
make sure RPMs in the container are upgraded, otherwise `yum history
undo last` fails miserably with missing packages errors.

Also this commit makes sure installation dies when we're unable to build
containers.

Change-Id: I29e19e13aa22047bfa07817a7794fc18612bbc32
2020-04-24 13:46:13 +02:00

27 lines
872 B
Docker

FROM centos:8
LABEL authors="Antoni Segura Puimedon<toni@kuryr.org>, Michał Dulko<mdulko@redhat.com>"
ARG UPPER_CONSTRAINTS_FILE="https://releases.openstack.org/constraints/upper/master"
RUN yum upgrade -y \
&& yum install -y epel-release \
&& yum install -y --setopt=tsflags=nodocs python3-pip libstdc++ \
&& yum install -y --setopt=tsflags=nodocs gcc gcc-c++ python3-devel git
COPY . /opt/kuryr-kubernetes
RUN pip3 install -c $UPPER_CONSTRAINTS_FILE --no-cache-dir /opt/kuryr-kubernetes \
&& yum -y history undo last \
&& yum clean all \
&& rm -rf /opt/kuryr-kubernetes \
&& groupadd -r kuryr -g 711 \
&& useradd -u 711 -g kuryr \
-d /opt/kuryr-kubernetes \
-s /sbin/nologin \
-c "Kuryr controller user" \
kuryr
USER kuryr
CMD ["--config-dir", "/etc/kuryr"]
ENTRYPOINT [ "kuryr-k8s-controller" ]