kuryr-libnetwork/Dockerfile
Pratik Raj 952e881922
optimize size and time using --no-cache-dir
Using --no-cache-dir flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Change-Id: Ia635ecb0eaea3a400a0b03031efec354d0c3c77e
Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2020-10-03 11:52:16 +05:30

40 lines
882 B
Docker

FROM alpine:3.4
MAINTAINER Antoni Segura Puimedon "toni@kuryr.org"
WORKDIR /
COPY . /opt/kuryr-libnetwork
RUN \
apk add --no-cache \
bash \
iproute2 \
openvswitch \
py-pip \
python \
uwsgi-python \
&& apk add --no-cache --virtual build-deps \
gcc \
git \
linux-headers \
musl-dev \
python-dev \
&& pip --no-cache-dir install -U pip setuptools \
\
&& cd /opt/kuryr-libnetwork \
&& pip --no-cache-dir install . \
&& cd / \
&& apk del build-deps
ENV SERVICE_USER="admin"
ENV SERVICE_PROJECT_NAME="admin"
ENV SERVICE_PASSWORD="pass"
ENV SERVICE_DOMAIN_NAME="Default"
ENV USER_DOMAIN_NAME="Default"
ENV IDENTITY_URL="http://127.0.0.1:5000/v3"
ENV CAPABILITY_SCOPE="local"
ENV HTTP_SOCKET=":23750"
ENV LOG_LEVEL="INFO"
ENV PROCESSES=2
VOLUME /var/log/kuryr
CMD ["/opt/kuryr-libnetwork/contrib/docker/run_kuryr.sh"]