Hi, I use something like:
# image: Ubuntu 24.04 ARM64
FROM --platform=linux/arm64 ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
curl wget vim git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . /app
CMD ["/bin/bash"]
and run docker build --platform=linux/arm64 -t my-ubuntu24.04-arm64 ., and get:
# docker build --network=host -t my-image .
[+] Building 1.6s (6/8) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 468B 0.0s
=> WARN: FromPlatformFlagConstDisallowed: FROM --platform flag should n 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:24.04 1.4s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [1/4] FROM docker.io/library/ubuntu:24.04@sha256:a08e551cb338 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 1.03kB 0.0s
=> ERROR [2/4] RUN apt-get update && apt-get install -y curl wget v 0.1s
------
> [2/4] RUN apt-get update && apt-get install -y curl wget vim git ca-certificates && rm -rf /var/lib/apt/lists/*:
0.071 exec /bin/sh: exec format error
------
1 warning found (use docker --debug to expand):
- FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "linux/arm64" (line 2)
Dockerfile:8
--------------------
7 |
8 | >>> RUN apt-get update && apt-get install -y \
9 | >>> curl wget vim git ca-certificates \
10 | >>> && rm -rf /var/lib/apt/lists/*
11 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y curl wget vim git ca-certificates && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 255
Please help me to fix this, thank you so much.
I can build it successfully almost 2 weeks ago, I donât know whatâs wrong right now.