我正在尝试使用以下Dockerfile构建一个简单的镜像:
FROM arm32v7/ubuntu:20.04
RUN touch tmp.txt
但是我收到了“操作不允许”的错误消息。
$ docker build .
Sending build context to Docker daemon 71.68kB
Step 1/2 : FROM arm32v7/ubuntu:20.04
---> bcf7edb34eae
Step 2/2 : RUN touch tmp.txt
---> Running in 686d92e86a27
touch: setting times of 'tmp.txt': Operation not permitted
这是在使用Hypriot OS的树莓派上发生的问题,但是相同的构建在我的笔记本电脑(x86和交叉编译)上构建得很好。
我知道这是某种权限错误,但我能够正常运行sudo命令,因此我真不知道该怎么办。
arm32v7
架构吗?现代的 Raspberry Pi 设备都配备了 64 位处理器。尝试将 'FROM' 指令更改为FROM ubuntu:20.04
,这样 Docker 就会自动选择适合你的架构。 - anemytegetconf LONG_BIT
输出 32,使用 64 位镜像会出现exec error
,64 位正在进行 beta 测试,详见此处。 - Gianmarco