Skip to content

Commit

Permalink
fix: Container random error build
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Jan 12, 2024
1 parent b96e6f2 commit 3088e86
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Base container
FROM docker.io/library/python:3.11-slim-bullseye@sha256:9f35f3a6420693c209c11bba63dcf103d88e47ebe0b205336b5168c122967edf AS base

RUN rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
apt-get update -q

# Build container
FROM base AS build

RUN rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked --mount=target=/root/.cache/pip,type=cache,sharing=locked \
apt-get install -y -q --no-install-recommends \
apt-get update -q \
&& apt-get install -y -q --no-install-recommends \
gcc \
python3-dev \
&& python3 -m pip install --upgrade \
Expand Down

0 comments on commit 3088e86

Please sign in to comment.