toolbox/doc/toolbox-init-container.1.md
Casey Jao c2e41553db Unbreak setting up /home as a symbolic link
The whole idea behind commit 66e982af72 was to set up $HOME and
/home to match the host. Therefore, it's pointless to check if /home
is a symbolic link or not inside the toolbox container. The state of
/home needs to be checked on the host, and then the toolbox container
adjusted accordingly.

One crucial difference is that the toolbox container is created before
its /home can be adjusted. Earlier, there was the user-specific
customized image, whose /home was adjusted first, and then the toolbox
container created from that. This boils down to the following
invocation happening before the symbolic link can be set up:
  podman create --volume "$HOME":$HOME":rslave --workdir "$HOME" ...

As a result, on host operating systems like Fedora 29 where /home is a
symbolic link with $HOME pointing inside it, Podman populates /home
with the user's sub-directory inside the toolbox container. This
prevents the subsequent 'rmdir $HOME' from working, and consequently
kills the container's entry point.

Compare that to Fedora 30 and newer where this problem doesn't occur
because /home is a symbolic link but $HOME points inside the target
/var/home directory.

This is why $HOME is canonicalized before bind mounting it into the
container and the container's working directory is reverted back to the
default (ie. /).

Fallout from 8b84b5e460

https://github.com/debarshiray/toolbox/issues/185
2019-06-17 23:28:34 +02:00

1.4 KiB

% toolbox-init-container(1)

NAME

toolbox-init-container - Initialize a running container

SYNOPSIS

toolbox init-container --home HOME --home-link --monitor-host --shell SHELL --uid UID --user USER

DESCRIPTION

Initializes a newly created container that's running. It is primarily meant to be used as the entry point for all toolbox containers, and must be run inside the container that's to be initialized. It is not expected to be directly invoked by humans, and cannot be used on the host.

OPTIONS

The following options are understood:

--home HOME

Create a user inside the toolbox container whose login directory is HOME.

--home-link

Make /home a symbolic link to /var/home.

--monitor-host

Ensure that certain configuration files inside the toolbox container are kept synchronized with their counterparts on the host. Currently, these files are /etc/hosts and /etc/resolv.conf.

--shell SHELL

Create a user inside the toolbox container whose login shell is SHELL.

--uid UID

Create a user inside the toolbox container whose numerical user ID is UID.

--user USER

Create a user inside the toolbox container whose login name is LOGIN.

SEE ALSO

podman(1), podman-create(1), podman-start(1)