- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有没有办法在 Podman 中运行 Podman,类似于在 Docker 中运行 Docker 的方式?
这是我的 Dockerfile 的一个片段,它强烈基于 another question :
FROM debian:10.6
RUN apt update && apt upgrade -qqy && \
apt install -qqy iptables bridge-utils \
qemu-kvm libvirt-daemon libvirt-clients virtinst libvirt-daemon-system \
cpu-checker kmod && \
apt -qqy install curl sudo gnupg2 && \
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && \
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/Release.key | sudo apt-key add - && \
apt update && \
apt -qqy install podman
现在尝试一些测试:
$ podman run -it my/test bash -c "podman --storage-driver=vfs info"
... (long output; this works fine)
$ podman run -it my/test bash -c "podman --storage-driver=vfs images"
ERRO[0000] unable to write system event: "write unixgram @000ec->/run/systemd/journal/socket: sendmsg: no such file or directory"
REPOSITORY TAG IMAGE ID CREATED SIZE
$ podman run -it my/test bash -c "podman --storage-driver=vfs run docker.io/library/hello-world"
ERRO[0000] unable to write system event: "write unixgram @000ef->/run/systemd/journal/socket: sendmsg: no such file or directory"
Trying to pull docker.io/library/hello-world...
Getting image source signatures
Copying blob 0e03bdcc26d7 done
Copying config bf756fb1ae done
Writing manifest to image destination
Storing signatures
ERRO[0003] unable to write pod event: "write unixgram @000ef->/run/systemd/journal/socket: sendmsg: no such file or directory"
ERRO[0003] Error preparing container 66692b7ff496775499d405d538769a078f2794549955cf2409fcbcbf87f42e94: error creating network namespace for container 66692b7ff496775499d405d538769a078f2794549955cf2409fcbcbf87f42e94: mount --make-rshared /var/run/netns failed: "operation not permitted"
Error: failed to mount shm tmpfs "/var/lib/containers/storage/vfs-containers/66692b7ff496775499d405d538769a078f2794549955cf2409fcbcbf87f42e94/userdata/shm": operation not permitted
我也尝试过
other question 的建议,通过
--cgroup-manager=cgroupfs
,但没有成功:
$ podman run -it my/test bash -c "podman --storage-driver=vfs --cgroup-manager=cgroupfs run docker.io/library/hello-world"
Trying to pull docker.io/library/hello-world...
Getting image source signatures
Copying blob 0e03bdcc26d7 done
Copying config bf756fb1ae done
Writing manifest to image destination
Storing signatures
ERRO[0003] unable to write pod event: "write unixgram @000f3->/run/systemd/journal/socket: sendmsg: no such file or directory"
ERRO[0003] Error preparing container c3fff4d8161903aaebd6f89f3b3c06b55038e11e07b6b561dc6576ca675747a3: error creating network namespace for container c3fff4d8161903aaebd6f89f3b3c06b55038e11e07b6b561dc6576ca675747a3: mount --make-rshared /var/run/netns failed: "operation not permitted"
Error: failed to mount shm tmpfs "/var/lib/containers/storage/vfs-containers/c3fff4d8161903aaebd6f89f3b3c06b55038e11e07b6b561dc6576ca675747a3/userdata/shm": operation not permitted
似乎需要一些网络配置。我发现下面的项目表明可能需要对网络配置进行一些调整,但我不知道它的上下文是什么以及它是否适用于此。
/var/run/podman.sock
,但也没有成功:
$ sudo podman run -it -v /run/podman/podman.sock:/run/podman/podman.sock my/test bash -c "podman --storage-driver=vfs --cgroup-manager=cgroupfs run docker.io/library/hello-world"
Trying to pull my/test...
denied: requested access to the resource is denied
Trying to pull my:test...
unauthorized: access to the requested resource is not authorized
Error: unable to pull my/text: 2 errors occurred:
* Error initializing source docker://my/test: Error reading manifest latest in docker.io/my/test: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
* Error initializing source docker://quay.io/my/test:latest: Error reading manifest latest in quay.io/my/test: unauthorized: access to the requested resource is not authorized
似乎
root
看不到我在我的用户下创建的图像。
最佳答案
假设我们想在 docker.io/library/alpine 容器中运行 ls /
。
标准 Podman
podman run --rm docker.io/library/alpine ls /
Podman 中的 Podman
ls /
,但这次我们在
quay.io/podman/stable 容器中运行
podman
。
podman \
run \
--rm \
--security-opt label=disable \
--user podman \
quay.io/podman/stable \
podman \
run \
--rm \
docker.io/library/alpine \
ls /
这是一个完整的例子:
$ podman --version
podman version 3.2.1
$ cat /etc/fedora-release
Fedora release 34 (Thirty Four)
$ uname -r
5.12.11-300.fc34.x86_64
$ podman \
run \
--rm \
--security-opt label=disable \
--user podman \
quay.io/podman/stable \
podman \
run \
--rm \
docker.io/library/alpine \
ls /
Trying to pull docker.io/library/alpine:latest...
Getting image source signatures
Copying blob sha256:5843afab387455b37944e709ee8c78d7520df80f8d01cf7f861aae63beeddb6b
Copying config sha256:d4ff818577bc193b309b355b02ebc9220427090057b54a59e73b79bdfe139b83
Writing manifest to image destination
Storing signatures
bin
dev
etc
home
lib
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
$
为避免重复下载内部容器镜像,
podman volume create mystorage
并添加命令行选项
-v mystorage:/home/podman/.local/share/containers:rw
到外部 Podman 命令。换句话说
podman \
run \
-v mystorage:/home/podman/.local/share/containers:rw \
--rm \
--security-opt label=disable \
--user podman \
quay.io/podman/stable \
podman \
run \
--rm \
docker.io/library/alpine \
ls /
Podman 中的 Podman(过时的答案)
ls /
,但这次我们在
quay.io/podman/stable 容器中运行
podman
。
podman \
run \
--privileged \
--rm \
--ulimit host \
-v /dev/fuse:/dev/fuse:rw \
-v ./mycontainers:/var/lib/containers:rw \
quay.io/podman/stable \
podman \
run \
--rm \
--user 0 \
docker.io/library/alpine ls
(这里的目录./mycontainers用于容器存储)
$ podman --version
podman version 2.1.1
$ mkdir mycontainers
$ podman run --privileged --rm --ulimit host -v /dev/fuse:/dev/fuse:rw -v ./mycontainers:/var/lib/containers:rw quay.io/podman/stable podman run --rm --user 0 docker.io/library/alpine ls | head -5
Trying to pull docker.io/library/alpine...
Getting image source signatures
Copying blob sha256:188c0c94c7c576fff0792aca7ec73d67a2f7f4cb3a6e53a84559337260b36964
Copying config sha256:d6e46aa2470df1d32034c6707c8041158b652f38d2a9ae3d7ad7e7532d22ebe0
Writing manifest to image destination
Storing signatures
bin
dev
etc
home
lib
$ podman run --privileged --rm --ulimit host -v /dev/fuse:/dev/fuse:rw -v ./mycontainers:/var/lib/containers:rw quay.io/podman/stable podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/alpine latest d6e46aa2470d 4 days ago 5.85 MB
如果您省略
-v ./mycontainers:/var/lib/containers:rw
,您可能会看到稍微令人困惑的错误消息
Error: executable file `ls` not found in $PATH: No such file or directory: OCI runtime command not found error
引用:
关于docker - Podman 中的 Podman,类似于 Docker 中的 Docker?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64509618/
是否有一种 STL 算法允许我将一个函数应用于一个范围内的每个元素,转换元素,并将之前转换的元素作为输入? 我在想这样的事情(显然行不通,因为第二个迭代器将无效): struct Input {
我有一个字典列表,例如: l =[{country:'Italy',sales:100,cost:50}{country:'Italy',sales:130,cost:60} {co
考虑以下几点: $var = 'Now is the time' if ($var -like 'Now*') { 'true' } else { 'false' } 输出:真 现在交换 -like
我认为这是一个简单的问题,但尚未得到解决方案。我只想从此处解释的列中获取有效数字。 假设我们有一个包含以下值的 varchar 列 ABC Italy Apple 234.62 2:234:43:22
这个问题已经有答案了: MySQL LIKE IN()? (12 个回答) 已关闭 4 年前。 是否可以使用 IN 子句扩展 LIKE 表达式? 此时我得到以下 SQL: select * from
这个问题在这里已经有了答案: How to postpone/defer the evaluation of f-strings? (14 个答案) 关闭 3 年前。 考虑字符串 string_0
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 8 年前。 Improve t
我刚刚阅读了以下关于同一主题的帖子: Facebook like notifications tracking (DB Design)和 Database design to store notifi
我如何在 javascript 中创建一个新事件/像在 c# 中一样? private event EventHandler asdCompleted; private void SetEventHa
我经常访问一个名为 GOOD 的网站我特别喜欢一种审美风格;导航栏如何在网站背景中扩展其颜色。如果您访问该网站,就会明白我的意思。 在 CSS 中,我怎样才能以最简单的方式复制它?我已经用 z-ind
我对 LINQ 比较陌生,不知道如何执行 Like 条件。我有一个 myObject 的 IEnumerable 列表,想要做一些类似 myObject.Description 的事情,比如“Help
我正在尝试在 Sharepoint 2013 提供商托管的应用程序中构建一个类似人员选择器的工具。最初,我使用的是 Utility.ResolvePrincipal,它让我可以访问 Sharepoin
过去几个月我一直在研究微服务架构应用程序,我仍在努力适应分布式特性。我多次注意到一种模式,但我不确定处理它的首选方式是什么。 假设我们有服务 A、服务 B 和服务 C。服务 A 公开了一个 API,其
这个问题在这里已经有了答案: Equivalent to unix "less" command within R console (5 个回答) 6年前关闭。 R 控制台中是否有任何命令与 Linu
是否可以在 Xcode 中为类似于 emacs 中的“标记”功能的行添加书签?还有我可以用来跳转到行号的快捷方式吗?我的源代码变得很长且难以导航。 最佳答案 是的;如果您将文本插入符号放在要添加书签的
在使用 vi 15 年的大部分时间后,我在使用 Go 时一时兴起尝试了 Rob Pike 的 Acme。我真的很喜欢它的小巧轻便。现代 unix 风格的东西在 Acme 中表现不佳,而 Ruby 开发
我正在寻找可以打印矩阵[1:5, 1:5] 的任何包中的函数。 head() 适用于列数较少但矩阵较大的用户。我知道我可以为它创建自己的函数,但我想知道是否已经有函数了。 最佳答案 在名为futile
我正在用 C++ 构建一个聚类算法,但我不能很好地处理 OOP 和发生变化的变量(成员数据)的状态。对于某种复杂的算法,我发现这是我发展的障碍。 因此,我正在考虑将编程语言更改为一种功能语言:Ocam
我有一个这样的日志: Jun 21 06:25:07 172.25.1.1 kernel: DROP IN=ppp0 OUT= MAC= SRC=206.221.177.2 DST=185.79.95
我需要一些帮助来制作类似于 Accordion 的东西。目标是,如果您单击导航中的链接,一个部分会消失,而您单击的部分会出现(在相同位置且不明显)。 如果可能,它还应该自动滚动到该部分的开头(导航的结
我是一名优秀的程序员,十分优秀!