amo*_*the 5 sh docker dockerfile rancher rancher-desktop
您好,以下是我的 docker 文件命令
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}
Run Code Online (Sandbox Code Playgroud)
我在 mac m1 芯片上使用 rancher 桌面。
执行以下命令时出现错误
docker build -t test --platform linux/x86_64 .
Run Code Online (Sandbox Code Playgroud)
错误信息如下
[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
Run Code Online (Sandbox Code Playgroud)
发现所有 shell 命令都不起作用,出现错误非零代码:127 如何解决此问题?
使用 rancher 版本1.5.0 使用容器运行时dockerd(moby) 使用 Kubernetes 版本v1.21.14
Dockerfile:
\n\xe2\x80\xa6\nFROM --platform=linux/arm64 debian:${debianVersion}\n\xe2\x80\xa6\nRun Code Online (Sandbox Code Playgroud)\n构建命令:
\ndocker build -t test --platform linux/arm64 .\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
4566 次 |
| 最近记录: |