Linuxkit是一个非常有趣的项目,所以开始使用它。我使用redis-os.yml示例https://raw.githubusercontent.com/linuxkit/linuxkit/master/examples/redis-os.yml创建了图像
当我引导redis-os时,它可以工作,但我没有看到任何redis服务器容器,我发现redis正在运行,但无法找到位置。
(ns: getty) linuxkit-f6b2836a15cb:~# pstree
init-+-containerd---7*[{containerd}]
|-containerd-shim-+-tini---rungetty.sh-+-rungetty.sh---login---sh
| | `-rungetty.sh---login---sh---bash--+
| `-11*[{containerd-shim}]
`-containerd-shim-+-redis-server---3*[{redis-server}]
`-11*[{containerd-shim}]。当我运行列表容器时,我没有看到任何redis容器。
(ns: getty) linuxkit-f6b2836a15cb:~# runc list
ID PID STATUS BUNDLE CREATED OWNER
000-dhcpcd 0 stopped /containers/onboot/000-dhcpcd 2022-08-12T21:38:05.40297821Z root我能看到瑞迪斯在港口听着
(ns: getty) linuxkit-f6b2836a15cb:~# netstat -natp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 421/redis-server
tcp 0 0 :::6379 :::* LISTEN 421/redis-server问题是redis容器在哪里,如何访问配置文件或exec容器文件系统?
发布于 2022-08-15 00:44:42
我发现,是的,它在名称空间中,但是语法与docker命令相比并不复杂。
(ns: getty) linuxkit-fa163e26c0e8:~# ctr -n services.linuxkit t exec -t --exec-id bash_1 redis sh
/data # redis-cli
127.0.0.1:6379> PING
PONG
127.0.0.1:6379>https://stackoverflow.com/questions/73341204
复制相似问题