0

Linuxkit is very interesting project so started playing with it. I have created image using redis-os.yml example https://raw.githubusercontent.com/linuxkit/linuxkit/master/examples/redis-os.yml

When i boot redis-os it works but i am not seeing any redis server container, i found redis is running but not able to find where.

(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}]

. when i run list container i am not seeing any redis container

  (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

I can see redis listen on port

(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

Question is where is redis container and how do i get to configuration file or exec container filesystem?

Satish
  • 16,544
  • 29
  • 93
  • 149
  • I don't know LinuxKit but I suppose that it relies on Linux namespaces. If you need to see the list of running containers, you need to be on host side. Your examples seem to show that you run your commands inside the container. So, you can't see what is running outsde of it. – Rachid K. Aug 13 '22 at 08:52

1 Answers1

0

I figured out, yes its in namespace but syntax are little complex compare to docker command.

(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>
Satish
  • 16,544
  • 29
  • 93
  • 149