Skip to content

Commit

Permalink
Abandon switch to slim since it has more complications with ARM build…
Browse files Browse the repository at this point in the history
… variants. We may need to split this into a multi-stage build to reduce the final image size (350MB uncompressed) and build times (current 38m on GitHub)
  • Loading branch information
jertel committed Sep 1, 2021
1 parent 1e44a88 commit 6170ad6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Fully qualified container name prevents public registry typosquatting
FROM docker.io/library/python:3-slim
FROM docker.io/library/python:3-alpine

ARG UID=1012
ARG GID=1012

RUN addgroup --system --gid $GID vuegraf
RUN adduser --system --gid $GID --uid $UID --home /opt/vuegraf vuegraf
RUN addgroup -S -g $GID vuegraf
RUN adduser -S -g $GID -u $UID -h /opt/vuegraf vuegraf

WORKDIR /opt/vuegraf

# Install pip dependencies with minimal container layer size growth
COPY src/requirements.txt ./
RUN set -x && \
apt update -y && \
apt upgrade -y && \
apk add --no-cache build-base libffi-dev rust cargo openssl-dev && \
pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
apk del build-base libffi-dev rust cargo openssl-dev && \
rm -rf /var/cache/apk /opt/vuegraf/requirements.txt

# Copying code in after requirements are built optimizes rebuild
Expand Down

0 comments on commit 6170ad6

Please sign in to comment.