Don't build caches into Docker images (#4537)

* Don't cache pip install data in the Docker image

* Don't cache Alpine Linux package data in the Docker image
This commit is contained in:
Matt Boersma 2017-09-25 13:19:53 -06:00 коммит произвёл Derek Bekoe
Родитель 32822b5a26
Коммит 4eb9eead63
4 изменённых файлов: 12 добавлений и 13 удалений

Просмотреть файл

@ -13,13 +13,13 @@ WORKDIR azure-cli
COPY . /azure-cli
# pip wheel - required for CLI packaging
# jmespath-terminal - we include jpterm as a useful tool
RUN pip install --upgrade pip wheel jmespath-terminal
RUN pip install --no-cache-dir --upgrade pip wheel jmespath-terminal
# bash gcc make openssl-dev libffi-dev musl-dev - dependencies required for CLI
# jq - we include jq as a useful tool
# openssh - included for ssh-keygen
# ca-certificates
# wget - required for installing jp
RUN apk update && apk add bash gcc make openssl-dev libffi-dev musl-dev jq openssh \
RUN apk add --no-cache bash gcc make openssl-dev libffi-dev musl-dev jq openssh \
ca-certificates wget openssl git && update-ca-certificates
# We also, install jp
RUN wget https://github.com/jmespath/jp/releases/download/0.1.2/jp-linux-amd64 -qO /usr/local/bin/jp && chmod +x /usr/local/bin/jp
@ -35,8 +35,8 @@ RUN /bin/bash -c 'TMP_PKG_DIR=$(mktemp -d); \
for f in $TMP_PKG_DIR/*; \
do MODULE_NAMES="$MODULE_NAMES $f"; \
done; \
pip install $MODULE_NAMES; \
pip install --force-reinstall --upgrade azure-nspkg azure-mgmt-nspkg;'
pip install --no-cache-dir $MODULE_NAMES; \
pip install --no-cache-dir --force-reinstall --upgrade azure-nspkg azure-mgmt-nspkg;'
# Tab completion
RUN echo -e "\

Просмотреть файл

@ -25,14 +25,13 @@ LABEL org.label-schema.schema-version="1.0" \
# INSTALL DEPENDENCIES
# pip wheel - required for CLI packaging
# jmespath-terminal - we include jpterm as a useful tool
RUN pip install --upgrade pip wheel jmespath-terminal
RUN pip install --no-cache-dir --upgrade pip wheel jmespath-terminal
# bash gcc openssl-dev libffi-dev musl-dev - dependencies required for CLI
# jq - we include jq as a useful tool
# openssh - included for ssh-keygen
# ca-certificates
# ca-certificates
# wget - required for installing jp
RUN apk update \
&& apk add bash gcc make openssl-dev libffi-dev musl-dev jq openssh ca-certificates wget openssl git \
RUN apk add --no-cache bash gcc make openssl-dev libffi-dev musl-dev jq openssh ca-certificates wget openssl git \
&& update-ca-certificates
# We also, install jp
RUN wget https://github.com/jmespath/jp/releases/download/0.1.2/jp-linux-amd64 -qO /usr/local/bin/jp \

Просмотреть файл

@ -5,10 +5,10 @@
FROM python:3.5.2-alpine
RUN apk update && apk upgrade && \
RUN apk upgrade --no-cache && \
apk add --no-cache bash git openssh
RUN pip install --upgrade pip gunicorn Flask wheel twine requests uritemplate.py
RUN pip install --no-cache-dir --upgrade pip gunicorn Flask wheel twine requests uritemplate.py
ADD app.py /

Просмотреть файл

@ -5,11 +5,11 @@
FROM python:3.5.2-alpine
RUN apk update && apk upgrade && \
RUN apk upgrade --no-cache && \
apk add --no-cache bash git openssh gcc make \
openssl-dev libffi-dev musl-dev ca-certificates openssl && update-ca-certificates
openssl-dev libffi-dev musl-dev ca-certificates openssl && update-ca-certificates
RUN pip install --upgrade pip wheel twine requests virtualenv uritemplate.py azure-cli sh
RUN pip install --no-cache-dir --upgrade pip wheel twine requests virtualenv uritemplate.py azure-cli sh
ADD . /