toolbx-images / images

Community maintained container images to use with toolbx and distrobox
https://containertoolbx.org/
Apache License 2.0
333 stars 30 forks source link

Alpine Image doesn't work: invalid entry point PID of container alpine #61

Closed tunix closed 1 year ago

tunix commented 1 year ago

Image and version of the image where the issue happens

quay.io/toolbx-images/alpine-toolbox:3.17

Describe the bug

I'm trying to use alpine:3.17 but it fails with below error:

$ toolbox create --image quay.io/toolbx-images/alpine-toolbox:3.17 alpine
Image required to create toolbox container.
Download quay.io/toolbx-images/alpine-toolbox:3.17 (500MB)? [y/N]: y
Created container: alpine
Enter with: toolbox enter alpine
[tunix@penguix ~]$ toolbox enter alpine
Error: invalid entry point PID of container alpine

Reproduction steps

First create the container:

$ toolbox create --image quay.io/toolbx-images/alpine-toolbox:3.17 alpine
Image required to create toolbox container.
Download quay.io/toolbx-images/alpine-toolbox:3.17 (500MB)? [y/N]: y
Created container: alpine
Enter with: toolbox enter alpine

Then try to use it:

$ toolbox -v enter alpine
DEBU Running as real user ID 1000
DEBU Resolved absolute path to the executable as /usr/bin/toolbox
DEBU Running on a cgroups v2 host
DEBU Checking if /etc/subgid and /etc/subuid have entries for user tunix
DEBU Validating sub-ID file /etc/subuid
DEBU Validating sub-ID file /etc/subgid
DEBU TOOLBOX_PATH is /usr/bin/toolbox
DEBU Migrating to newer Podman
DEBU Toolbox config directory is /var/home/tunix/.config/toolbox
DEBU Current Podman version is 4.3.1
DEBU Creating runtime directory /run/user/1000/toolbox
DEBU Old Podman version is 4.3.1
DEBU Migration not needed: Podman version 4.3.1 is unchanged
DEBU Setting up configuration
DEBU Setting up configuration: file /var/home/tunix/.config/containers/toolbox.conf not found
DEBU Resolving image name
DEBU Distribution (CLI): ''
DEBU Image (CLI): ''
DEBU Release (CLI): ''
DEBU Resolved image name
DEBU Image: 'fedora-toolbox:37'
DEBU Release: '37'
DEBU Resolving container name
DEBU Container: ''
DEBU Image: 'fedora-toolbox:37'
DEBU Release: '37'
DEBU Resolved container name
DEBU Container: 'fedora-toolbox-37'
DEBU Resolving image name
DEBU Distribution (CLI): ''
DEBU Image (CLI): ''
DEBU Release (CLI): ''
DEBU Resolved image name
DEBU Image: 'fedora-toolbox:37'
DEBU Release: '37'
DEBU Resolving container name
DEBU Container: 'alpine'
DEBU Image: 'fedora-toolbox:37'
DEBU Release: '37'
DEBU Resolved container name
DEBU Container: 'alpine'
DEBU Checking if container alpine exists
DEBU Inspecting mounts of container alpine
DEBU Starting container alpine
DEBU Inspecting entry point of container alpine
DEBU Entry point PID is a float64
DEBU Entry point of container alpine is toolbox (PID=0)
Error: invalid entry point PID of container alpine

Host distribution and version, toolbx and podman versions

Host Distribution & Version

$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="37.20230130.0 (Silverblue)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37.20230130.0 (Silverblue)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://silverblue.fedoraproject.org"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora-silverblue/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://github.com/fedora-silverblue/issue-tracker/issues"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
SUPPORT_END=2023-11-14
VARIANT="Silverblue"
VARIANT_ID=silverblue
OSTREE_VERSION='37.20230130.0'

Toolbox Version

$ rpm -qi toolbox
Name        : toolbox
Version     : 0.0.99.3
Release     : 7.fc37
Architecture: x86_64
Install Date: Pzt 30 Oca 2023 03:27:27
Group       : Unspecified
Size        : 7590060
License     : ASL 2.0
Signature   : RSA/SHA256, Cts 23 Tem 2022 18:20:10, Key ID f55ad3fb5323552a
Source RPM  : toolbox-0.0.99.3-7.fc37.src.rpm
Build Date  : Cts 23 Tem 2022 13:47:39
Build Host  : buildvm-x86-05.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://containertoolbx.org/
Bug URL     : https://bugz.fedoraproject.org/toolbox
Summary     : Tool for containerized command line environments on Linux
Description :
Toolbox is a tool for Linux operating systems, which allows the use of
containerized command line environments. It is built on top of Podman and
other standard container technologies from OCI.

Podman Version

$ podman -v
podman version 4.3.1
travier commented 1 year ago

Running:

$ podman start alpine
$ podman log alpine
level=debug msg="Running as real user ID 0"
level=debug msg="Resolved absolute path to the executable as /usr/bin/toolbox"
level=debug msg="TOOLBOX_PATH is /usr/bin/toolbox"
level=debug msg="Migrating to newer Podman"
level=debug msg="Setting up configuration"
level=debug msg="Setting up configuration: file /etc/containers/toolbox.conf not found"
level=debug msg="Setting up configuration: file /var/home/tim/.config/containers/toolbox.conf not found"
level=debug msg="Resolving image name"
level=debug msg="Distribution (CLI): ''"
level=debug msg="Image (CLI): ''"
level=debug msg="Release (CLI): ''"
level=debug msg="Resolved image name"
level=debug msg="Image: 'fedora-toolbox:34'"
level=debug msg="Release: '34'"
level=debug msg="Resolving container name"
level=debug msg="Container: ''"
level=debug msg="Image: 'fedora-toolbox:34'"
level=debug msg="Release: '34'"
level=debug msg="Resolved container name"
level=debug msg="Container: 'fedora-toolbox-34'"
level=debug msg="Creating /run/.toolboxenv"
level=debug msg="Monitoring host"
level=debug msg="Path /run/host/etc exists"
level=debug msg="Preparing to redirect /etc/host.conf to /run/host/etc/host.conf"
level=debug msg="/run/host/etc/host.conf isn't a symbolic link"
level=debug msg="Redirecting /etc/host.conf to /run/host/etc/host.conf"
level=debug msg="Preparing to redirect /etc/hosts to /run/host/etc/hosts"
level=debug msg="/run/host/etc/hosts isn't a symbolic link"
level=debug msg="Redirecting /etc/hosts to /run/host/etc/hosts"
level=debug msg="Preparing to redirect /etc/localtime to /run/host/etc/localtime"
level=debug msg="/run/host/etc/localtime is a symbolic link"
level=debug msg="Redirecting /etc/localtime to /run/host/etc/localtime"
level=debug msg="Resolved /etc/localtime to /run/host/usr/share/zoneinfo/Europe/Paris"
level=debug msg="Preparing to redirect /etc/resolv.conf to /run/host/etc/resolv.conf"
level=debug msg="/run/host/etc/resolv.conf isn't a symbolic link"
level=debug msg="Redirecting /etc/resolv.conf to /run/host/etc/resolv.conf"
level=debug msg="Creating regular file /etc/machine-id"
level=debug msg="Binding /etc/machine-id to /run/host/etc/machine-id"
level=debug msg="Creating directory /run/libvirt"
level=debug msg="Binding /run/libvirt to /run/host/run/libvirt"
level=debug msg="Creating directory /run/systemd/journal"
level=debug msg="Binding /run/systemd/journal to /run/host/run/systemd/journal"
level=debug msg="Creating directory /run/systemd/resolve"
level=debug msg="Binding /run/systemd/resolve to /run/host/run/systemd/resolve"
level=debug msg="Creating directory /run/udev/data"
level=debug msg="Binding /run/udev/data to /run/host/run/udev/data"
level=debug msg="Creating directory /tmp"
level=debug msg="Binding /tmp to /run/host/tmp"
level=debug msg="Creating directory /var/lib/flatpak"
level=debug msg="Binding /var/lib/flatpak to /run/host/var/lib/flatpak"
level=debug msg="Creating directory /var/lib/libvirt"
level=debug msg="Binding /var/lib/libvirt to /run/host/var/lib/libvirt"
level=debug msg="Creating directory /var/lib/systemd/coredump"
level=debug msg="Binding /var/lib/systemd/coredump to /run/host/var/lib/systemd/coredump"
level=debug msg="Creating directory /var/log/journal"
level=debug msg="Binding /var/log/journal to /run/host/var/log/journal"
level=debug msg="Creating directory /var/mnt"
level=debug msg="Binding /var/mnt to /run/host/var/mnt"
level=debug msg="Preparing to redirect /media to /run/media"
level=debug msg="/run/media isn't a symbolic link"
Error: failed to redirect /media to /run/media: remove /media: directory not empty

Looks like we have something in /media causing the issue:

$ podman run --rm -ti quay.io/toolbx-images/alpine-toolbox:3.17 bash
bc710b2b7cf6:/# ls /media/
cdrom  floppy  usb
bc710b2b7cf6:/# ls /media/
travier commented 1 year ago

And capsh missing.