Docker 如何在podman映像中创建用户帐户?
我是docker/podman的新手。我能够创建基本映像,并将内容放入其中(如java、mongodb等),然后让它们运行。但就我个人而言,我似乎无法在播客图像中创建用户帐户。我在谷歌上到处搜索,这就是我来这里的原因 系统/平台:Docker 如何在podman映像中创建用户帐户?,docker,podman,Docker,Podman,我是docker/podman的新手。我能够创建基本映像,并将内容放入其中(如java、mongodb等),然后让它们运行。但就我个人而言,我似乎无法在播客图像中创建用户帐户。我在谷歌上到处搜索,这就是我来这里的原因 系统/平台: centos8 FROM fedora:latest RUN useradd --uid 1000 --user-group -s /bin/bash stress USER stress ENTRYPOINT ["/bin/bash"] nter code he
centos8
FROM fedora:latest
RUN useradd --uid 1000 --user-group -s /bin/bash stress
USER stress
ENTRYPOINT ["/bin/bash"] nter code here
[stress@localhost PodmanImages]$ podman build .
STEP 1: FROM fedora:latest
Getting image source signatures
Copying blob 00c5bb959822 done
Copying config 8c2e0da7c4 done
Writing manifest to image destination
Storing signatures
STEP 2: RUN useradd --uid 1000 --user-group -s /bin/bash stress
useradd: /etc/passwd.1: lock file already used
useradd: cannot lock /etc/passwd; try again later.
Error: error building at STEP "RUN useradd --uid 1000 --user-group -s /bin/bash stress":
error while running runtime: exit status 1
Dockerfile:
centos8
FROM fedora:latest
RUN useradd --uid 1000 --user-group -s /bin/bash stress
USER stress
ENTRYPOINT ["/bin/bash"] nter code here
[stress@localhost PodmanImages]$ podman build .
STEP 1: FROM fedora:latest
Getting image source signatures
Copying blob 00c5bb959822 done
Copying config 8c2e0da7c4 done
Writing manifest to image destination
Storing signatures
STEP 2: RUN useradd --uid 1000 --user-group -s /bin/bash stress
useradd: /etc/passwd.1: lock file already used
useradd: cannot lock /etc/passwd; try again later.
Error: error building at STEP "RUN useradd --uid 1000 --user-group -s /bin/bash stress":
error while running runtime: exit status 1
命令:
centos8
FROM fedora:latest
RUN useradd --uid 1000 --user-group -s /bin/bash stress
USER stress
ENTRYPOINT ["/bin/bash"] nter code here
[stress@localhost PodmanImages]$ podman build .
STEP 1: FROM fedora:latest
Getting image source signatures
Copying blob 00c5bb959822 done
Copying config 8c2e0da7c4 done
Writing manifest to image destination
Storing signatures
STEP 2: RUN useradd --uid 1000 --user-group -s /bin/bash stress
useradd: /etc/passwd.1: lock file already used
useradd: cannot lock /etc/passwd; try again later.
Error: error building at STEP "RUN useradd --uid 1000 --user-group -s /bin/bash stress":
error while running runtime: exit status 1
当我实际进入从映像创建的容器并尝试运行useradd命令时,我会遇到相同的错误
[stress@localhost PodmanImages]$ podman run --rm --name game -it
registry.fedoraproject.org/fedora /bin/bash
[root@c43c5df75db6 /]# useradd --uid 1000 --user-group -s /bin/bash stress
useradd: /etc/passwd.20: lock file already used
useradd: cannot lock /etc/passwd; try again later.
[root@c43c5df75db6 /]# exit
exit
[stress@localhost PodmanImages]$
我已经删除了在容器中创建的锁文件,并尝试再次运行useradd命令,但它始终显示相同的错误
如果有人能为我解释这件事,我会非常高兴的
非常感谢您的考虑 在保险丝覆盖层中有一个现已修复的保险丝,
但是错误修正还没有进入Centos 8
作为一种解决方法,您可以添加命令行选项--storage driver=vfs
作为podman的第一个命令行参数。比如说
podman——存储驱动程序=vfs构建。
该解决方案在Centos 8上对我有效。在中有一个保险丝覆盖层现在已经修复,
但是错误修正还没有进入Centos 8
作为一种解决方法,您可以添加命令行选项--storage driver=vfs
作为podman的第一个命令行参数。比如说
podman——存储驱动程序=vfs构建。
这个解决方案在Centos 8上对我有效