我希望能够运行podman容器,以运行CI/CD管道。然而,我一直从podman容器中收到以下错误:
$ podman info
ERRO[0000] 'overlay' is not supported over overlayfs
Error: could not get runtime: 'overlay' is not supported over overlayfs: backing file system is unsupported for this graph driver
我正在使用Jenkins Kubernetes插件编写CI/CD流水线,以作为Kubernetes集群中的容器运行。我已成功编写了使用Docker-in-Docker容器运行
docker build
和docker push
命令的流水线。然而,在容器内运行Docker客户端和Docker Daemon会使CI/CD环境非常臃肿、难以配置,不是理想的工作方式。因此,我想我可以使用podman从Dockerfiles构建Docker镜像,而不使用庞大的Docker Daemon。
问题在于podman太新了,以至于我还没有看到有人尝试过这样做,也不是足够熟练的podman专家来正确执行这个任务。
因此,使用Ubuntu上的podman安装说明,我创建了以下Dockerfile:
FROM ubuntu:16.04
RUN apt-get update -qq \
&& apt-get install -qq -y software-properties-common uidmap \
&& add-apt-repository -y ppa:projectatomic/ppa \
&& apt-get update -qq \
&& apt-get -qq -y install podman
# To keep it running
CMD tail -f /dev/null
于是我构建了这个镜像并按照以下方式运行它:
# Build
docker build -t podman:ubuntu-16.04 .
# Run
docker run --name podman -d podman:ubuntu-16.04
然后在正在运行的容器上运行此命令时,我遇到了一个错误:
$ docker exec -ti podman bash -c "podman info"
ERRO[0000] 'overlay' is not supported over overlayfs
Error: could not get runtime: 'overlay' is not supported over overlayfs: backing file system is unsupported for this graph driver
我在一台运行Ubuntu 16.04的机器上安装了podman,并运行了相同的命令
podman info
,结果符合预期:host:
BuildahVersion: 1.8-dev
Conmon:
package: 'conmon: /usr/libexec/crio/conmon'
path: /usr/libexec/crio/conmon
version: 'conmon version , commit: '
Distribution:
distribution: ubuntu
version: "16.04"
MemFree: 2275770368
MemTotal: 4142137344
OCIRuntime:
package: 'cri-o-runc: /usr/lib/cri-o-runc/sbin/runc'
path: /usr/lib/cri-o-runc/sbin/runc
version: 'runc version spec: 1.0.1-dev'
SwapFree: 2146758656
SwapTotal: 2146758656
arch: amd64
cpus: 2
hostname: jumpbox-4b3620b3
kernel: 4.4.0-141-generic
os: linux
rootless: false
uptime: 222h 46m 33.48s (Approximately 9.25 days)
insecure registries:
registries: []
registries:
registries:
- docker.io
store:
ConfigFile: /etc/containers/storage.conf
ContainerStore:
number: 0
GraphDriverName: overlay
GraphOptions: null
GraphRoot: /var/lib/containers/storage
GraphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
ImageStore:
number: 15
RunRoot: /var/run/containers/storage
VolumePath: /var/lib/containers/storage/volumes
有人知道我该如何修复这个错误并让podman在容器中正常工作吗?
podman info
命令会产生错误,输出如下:ERRO[0000] unable to write system event: "write unixgram @00006->/run/systemd/journal/socket: sendmsg: no such file or directory"
。当我尝试运行容器podman --storage-driver=vfs run docker.io/hello-world
时,会出现更多错误。 - Eldad Assis--cgroup-manager=cgroupfs
。即使没有--privileged
,它似乎也能正常工作。 - el-davo