Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start podman socket inside official v3.2.3 image #11354

Closed
rostrovsky opened this issue Aug 30, 2021 · 2 comments
Closed

Cannot start podman socket inside official v3.2.3 image #11354

rostrovsky opened this issue Aug 30, 2021 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@rostrovsky
Copy link

rostrovsky commented Aug 30, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I am unable to start podman socket inside quay.io/podman/stable:v3.2.3. I would like to start podman socket in order to use it with docker-compose installed inside the container.

Steps to reproduce the issue:

  1. docker run --rm -it --privileged quay.io/podman/stable:v3.2.3
  2. (inside the container) sudo systemctl start podman.socket

Describe the results you received:

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

Describe the results you expected:
Socket is up and running so

sudo curl -H "Content-Type: application/json" --unix-socket /var/run/docker.sock http://localhost/_ping

would return OK.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:      3.2.3
API Version:  3.2.3
Go Version:   go1.16.5
Built:        Fri Jul 16 20:33:32 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.21.3
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - hugetlb
  - pids
  - rdma
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.29-2.fc34.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.29, commit: '
  cpus: 2
  distribution:
    distribution: fedora
    version: "34"
  eventLogger: file
  hostname: cbe4abd087ab
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.4.39-linuxkit
  linkmode: dynamic
  memFree: 331476992
  memTotal: 2084323328
  ociRuntime:
    name: crun
    package: crun-0.20.1-1.fc34.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.20.1
      commit: 0d42f1109fd73548f44b01b3e84d04a279e99d2e
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SE
TPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 1073737728
  swapTotal: 1073737728
  uptime: 39m 20.64s
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /var/lib/shared
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.5.0-1.fc34.x86_64
      Version: |-
        fusermount3 version: 3.10.4
        fuse-overlayfs: version 1.5
        FUSE library version 3.10.4
        using FUSE kernel interface version 7.31
    overlay.mountopt: nodev,fsync=0
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 0
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.2.3
  Built: 1626467612
  BuiltTime: Fri Jul 16 20:33:32 2021
  GitCommit: ""
  GoVersion: go1.16.5
  OsArch: linux/amd64
  Version: 3.2.3

Package info (e.g. output of rpm -q podman or apt list podman):

N/A

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

No

Additional environment details (AWS, VirtualBox, physical, etc.):
Podman run inside docker container.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 30, 2021
@vrothberg
Copy link
Member

Thanks for reaching out.

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

That's summarizing the issue; systemd needs to run inside the container in order to make use of systemd services. See the docs for more on that.

For running Podman inside a container, I suggest having a look at the following article:
https://www.redhat.com/sysadmin/podman-inside-container

@rostrovsky
Copy link
Author

rostrovsky commented Sep 8, 2021

Thanks @vrothberg but my case is somewhat different.

I needed to run podman inside container started by docker and to use docker-compose with podman socket (to make it even funnier, I am using Docker Desktop on Windows 10)

Solution described in https://www.redhat.com/sysadmin/podman-docker-compose didn't work due to the systemd issue. Fortunately I have found fabric8io/docker-maven-plugin#1330 (comment) that finally helped me.

Solution

# in windows:
docker run --rm -it --privileged quay.io/podman/stable:v3.2.3

# inside podman container:
podman system service --time=0 &
export DOCKER_HOST="unix:/run/podman/podman.sock"
sudo curl -H "Content-Type: application/json" --unix-socket /run/podman/podman.sock http://localhost/_ping
OK
python3 -m ensurepip && python3 -m pip install pip --upgrade && pip install docker-compose
docker-compose up

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

2 participants