hi following are my docker file commands
ARG debianVersion=10.2
FROM debian:${debianVersion}
ARG user=jenkins
ARG group=jenkins
ARG uid=1000
ARG gid=1000
ARG AGENT_WORKDIR=/home/${user}/agent
USER root
RUN apt-get update
RUN groupadd -g ${gid} ${group}
RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user}
I am using rancher desktop on mac m1 chip.
On executing following command I a getting error
docker build -t test --platform linux/x86_64 .
Error message is as follows
[Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
---> Running in 7778b2303192
-c: 0: Can't open apt-get update
The command '/bin/sh -c apt-get update' returned a non-zero code: 127
Found that none of the shell commands are working getting error a non-zero code: 127 how to fix this?
Using rancher version 1.5.0
Using container runtime dockerd(moby)
Using Kubernetes version v1.21.14
3
Answers
Dockerfile:
Build command:
Downgrade to Rancher Desktop 1.4.1.
This works but if downgrading is not an option there are workarounds on the Rancher Desktop Issues site for similar problems like this:
qemu workaround
Easy way to connect to the VM and run those commands is (source):
As far as I understand it
dockerd
runtime can only emulate other platform types (in the above case--platform=linux/amd64
) on them1 chip
macs usingDocker Desktop
.Try using the built in
nerdctl
that comes packaged withRancher Desktop
:N.B. I have found that even with emulation, some
--platform linux/x86_64
(linux/amd64) images still cannot be built, recently experienced that with officialselenium
set, but had no problem withwso2
&mailcatcher
images