我最近切换回了podman,我的容器出现了一个错误。
容器文件:
FROM scratch
ADD ./run /
ENTRYPOINT ["/run"]
我的应用程序都是静态build go微服务:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o ${BINARY_NAME} *.go
一切都是通过Makefile来管理的。在docker下,一切都运行得很好,但在podman下,我得到了这个错误。
Error: OCI runtime error: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/run/containers/storage/overlay-containers/5709a135a4f1537fea1fdf8a5750534bc0f782671f115e73201569495024e4fc/userdata/.containerenv" to rootfs at "/run/.containerenv" caused: mount through procfd: open o_path procfd: open /var/lib/containers/storage/overlay/cc55a7c625e1483cc644660c8161db8a4a4a8b9c1120d132f07593834fda1a2c/merged/run/.containerenv: not a directory
我的run命令是
podman run -d localhost/test:1.0.0
操作系统信息: Ubuntu 21.04
内核:5.11.0-22-通用
Podman: 3.0.1
当我使用另一个容器时,它在podman下工作得很好。
发布于 2021-07-04 21:06:53
为了确认,不要给可执行文件命名,就像标准linux目录一样。
感谢Erik Sjölund
https://stackoverflow.com/questions/68244469
复制相似问题