Trying to run docker build with ```ARG PYTHON_VERS...
# cloud
w
Trying to run docker build with
Copy code
ARG PYTHON_VERSION=3.11.6
FROM python:${PYTHON_VERSION}-slim base image
And the build is failing on step 3/10 (details in thread) Worked with
Copy code
ARG PYTHON_VERSION=3.11.6
FROM python:${PYTHON_VERSION}-bullseye
Can I use that base image instead? Anyone else is facing the same?
39.42 E: Failed to fetch http://deb.debian.org/debian/pool/main/p/python3.11/python3.11-minimal_3.11.2-6%2bdeb12u6_arm64.deb Hash Sum mismatch 39.42 Hashes of expected file: 39.42 - SHA256:44196e58ef8c3ccae9d9f03055273d8cc647d27f93548ea76a1f96b0e531b8a1 39.42 - MD5Sum:5fd6bd6130d453a17ecb3e94f4205819 [weak] 39.42 - Filesize:1859096 [weak] 39.42 Hashes of received file: 39.42 - SHA256:198ff45b27bbcc3f72726c11f14e9f5ca4c821a1587fa7392c9c370cd380ca26 39.42 - MD5Sum:6e92298109a005b92ec3375186d78435 [weak] 39.42 - Filesize:1859096 [weak] 39.42 Last modification reported: Sat, 03 May 2025 193543 +0000 39.42 E: Failed to fetch http://deb.debian.org/debian/pool/main/i/isl/libisl23_0.25-1.1_arm64.deb Hash Sum mismatch 39.42 Hashes of expected file: 39.42 - SHA256:e7232e299714254a9473d7eacdf6879eedf02b950c87da145f5d605800710c6c 39.42 - MD5Sum:cf54a84feab8ba9487989cc9f53f22d6 [weak] 39.42 - Filesize:609984 [weak] 39.42 Hashes of received file: 39.42 - SHA256:b5ed1a183065d6088a83d9da1419e5719f7a027cb00b855dde143de8e6d00e7b 39.42 - MD5Sum:720f99cb9af0d6fb7a95bf00cd458753 [weak] 39.42 - Filesize:609984 [weak] 39.42 Last modification reported: Sat, 20 Jan 2024 172355 +0000 39.42 E: Failed to fetch http://deb.debian.org/debian/pool/main/g/gcc-12/libasan8_12.2.0-14%2bdeb12u1_arm64.deb Hash Sum mismatch 39.42 Hashes of expected file: 39.42 - SHA256:e458ed0f5a845d0f247de5985aa2478e78619e3bf054de7a2a02ec5e200e34f4 39.42 - MD5Sum:7db55837d2a3bed11a82548213aa99aa [weak] 39.42 - Filesize:2096136 [weak] 39.42 Hashes of received file: 39.42 - SHA256:4d2da660cd12c1df54483651601bafb3d9f72a4b81e12238f51a206f9b9f66c2 39.42 - MD5Sum:6986aa8d52286ef03682946519eb5d4d [weak] 39.42 - Filesize:2096136 [weak] 39.42 Last modification reported: Tue, 15 Apr 2025 005948 +0000 39.42 E: Failed to fetch http://deb.debian.org/debian/pool/main/libn/libnsl/libnsl-dev_1.3.0-2_arm64.deb Hash Sum mismatch 39.42 Hashes of expected file: 39.42 - SHA256:baf8a2ef1e9faec26dd84e62d0e8b653f54d2211a7a89c1b67965aee8a3da790 39.42 - MD5Sum:3f75ddababd89cae452c9ab33e4e6f8c [weak] 39.42 - Filesize:66132 [weak] 39.42 Hashes of received file: 39.42 - SHA256:e1f88651bca64f6509998a18afdb46430c71b6d66644d324109ede124668db99 39.42 - MD5Sum:5cb9ee4bd4b38c1927fdd130ba350357 [weak] 39.42 - Filesize:66132 [weak] 39.42 Last modification reported: Sat, 10 Oct 2020 145626 +0000 39.42 E: Failed to fetch http://deb.debian.org/debian/pool/main/l/lerc/liblerc4_4.0.0%2bds-2_arm64.deb Hash Sum mismatch 39.42 Hashes of expected file: 39.42 - SHA256:c5294ed128ac375249098c43be9805c787ed1c65703fe1d877ead4213904f123 39.42 - MD5Sum:74e9d29492c42c52899acf59940b227a [weak] 39.42 - Filesize:137640 [weak] 39.42 Hashes of received file: 39.42 - SHA256:55ee0778cd04715d1a2f6085d1aa1758fdab57edf25ce82cb17932dd765e301e 39.42 - MD5Sum:e6a38df3e5395546080194fb34131972 [weak] 39.42 - Filesize:137640 [weak] 39.42 Last modification reported: Sat, 15 Oct 2022 095822 +0000 39.42 E: Failed to fetch http://deb.debian.org/debian/pool/main/libx/libx11/libx11-data_1.8.4-2%2bdeb12u2_all.deb Hash Sum mismatch 39.42 Hashes of expected file: 39.42 - SHA256:987a848aeb1c358e4186368871b0526f10bb14c6b53214ab3bf8b69abb830191 39.42 - MD5Sum:85ab85cc2396aafb5a525bac782d8ec9 [weak] 39.42 - Filesize:291884 [weak] 39.42 Hashes of received file: 39.42 - SHA256:44c9bc10c1a4aee45878e4d1423c639da7391d5f4bee85ad012fe7634e29ac45 39.42 - MD5Sum:eac033c05ac36955844faaa994cde09a [weak] 39.42 - Filesize:291884 [weak] 39.42 Last modification reported: Tue, 03 Oct 2023 091735 +0000 39.42 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? ------ Dockerfile:25 -------------------- 24 | # Install gcc, g++ and other build dependencies. 25 | >>> RUN apt-get update && \ 26 | >>> apt-get install -y \ 27 | >>> gcc \ 28 | >>> g++ \ 29 | >>> python3-dev \ 30 | >>> && rm -rf /var/lib/apt/lists/* 31 | -------------------- ERROR: failed to build: failed to solve: process “/bin/sh -c apt-get update && apt-get install -y gcc g++ python3-dev && rm -rf /var/lib/apt/lists/*” did not complete successfully: exit code: 100
d
absolutely, you could def change the base image.. though it's a bit strange why this is happening at all. Do you mind sharing the Dockerfile with us here?
w
Sure
Here is it
Copy code
# This is an example Dockerfile that builds a minimal container for running LK Agents
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11.6
FROM python:${PYTHON_VERSION}-bullseye

# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1

# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1

# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
ARG UID=10001
RUN adduser \
    --disabled-password \
    --gecos "" \
    --home "/home/appuser" \
    --shell "/sbin/nologin" \
    --uid "${UID}" \
    appuser

# Install gcc, g++ and other build dependencies.
RUN apt-get update && \
    apt-get install -y \
    gcc \
    g++ \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

USER appuser

RUN mkdir -p /home/appuser/.cache
RUN chown -R appuser /home/appuser/.cache

WORKDIR /home/appuser

COPY requirements.txt .
RUN python -m pip install --user --no-cache-dir -r requirements.txt

COPY . .

# ensure that any dependent models are downloaded at build-time
RUN python agent.py download-files

# Run the application.
ENTRYPOINT ["python", "agent.py"]
CMD ["start"]
The only difference was that I used slim
r
I am curious if you can try adding
--no-cache
to your
docker build
command to ensure that Docker does not use cached layers for
-slim
.