Install python packages from ubuntu's repositories

Also reduces image size by updating, installing and cleaning
packages in one single step
This commit is contained in:
Carlos Álvaro
2019-02-23 17:07:00 +01:00
parent 6489ae809d
commit ac9b1bb3cd
2 changed files with 30 additions and 41 deletions

View File

@@ -9,16 +9,7 @@ ENV SALT_VERSION="2018.3.4" \
LIBSSH2_VERSION="1.8.0" \
LIBGIT2_VERSION="0.27.7" \
PYGIT2_VERSION="0.27.2" \
GITPYTHON_VERSION="2.1.11" \
M2CRYPTO_VERSION="0.31.0" \
MAKO_VERSION="1.0.7" \
PYCRYPTODOME_VERSION="3.7.2" \
LIBNACL_VERSION="1.6.1" \
RAET_VERSION="0.6.8" \
CHERRYPY_VERSION="18.0.1" \
TIMELIB_VERSION="0.2.4" \
DOCKERPY_VERSION="1.10.6" \
MSGPACKPURE_VERSION="0.1.3"
M2CRYPTO_VERSION="0.31.0"
ENV SALT_DOCKER_DIR="/etc/docker-salt" \
SALT_ROOT_DIR="/etc/salt" \
@@ -35,24 +26,21 @@ ENV SALT_CONFS_DIR="${SALT_DATA_DIR}/config" \
SALT_BASE_DIR="${SALT_DATA_DIR}/srv" \
SALT_LOGS_DIR="${SALT_DATA_DIR}/logs"
# Set non interactive mode
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir -p ${SALT_BUILD_DIR}
WORKDIR ${SALT_BUILD_DIR}
# Install packages
RUN apt-get update
RUN apt-get install --yes --quiet --no-install-recommends \
sudo ca-certificates wget locales pkg-config openssh-client \
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
sudo ca-certificates apt-transport-https wget locales pkg-config openssh-client \
python${PYTHON_VERSION} python${PYTHON_VERSION}-dev \
python3-pip python3-setuptools python3-wheel gettext-base \
supervisor logrotate
# Configure locales
RUN update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX \
python3-pip python3-setuptools python3-wheel \
supervisor logrotate git gettext-base tzdata \
&& DEBIAN_FRONTEND=noninteractive update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX \
locale-gen en_US.UTF-8 \
dpkg-reconfigure locales
dpkg-reconfigure locales \
&& DEBIAN_FRONTEND=noninteractive apt-get clean --yes \
&& rm -rf /var/lib/apt/lists/*
# Install saltstack
COPY assets/build ${SALT_BUILD_DIR}
@@ -67,8 +55,6 @@ COPY assets/runtime ${SALT_RUNTIME_DIR}
RUN chmod -R +x ${SALT_RUNTIME_DIR}
# Cleaning tasks
RUN apt-get clean --yes
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf ${SALT_BUILD_DIR}/*
# Entrypoint