commit | 55471e76b82768bbdb42854d1d56cc7bf43d2587 | [log] [tgz] |
---|---|---|
author | Micah Abbott <miabbott@redhat.com> | Tue Feb 01 17:13:57 2022 -0500 |
committer | Micah Abbott <miabbott@redhat.com> | Wed Feb 02 16:13:39 2022 -0500 |
tree | 4c50b2b23ab526b1e14ed1d2ceaf7dafbb41123f | |
parent | e35e6d74514a00d9d866f95a97e303830d5d8cfe [diff] |
rhcos-toolbox: check for an empty RUN label `podman` returns `<no value>` when inspecting a label that does not exist. That string is interpreted as the presence of a RUN label, so we try to start the container with a non-existent RUN label. Use some go formatting to return an empty string when the label is empty. We've somehow avoided this until it was reported in RHBZ#2048789. Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
toolbox is a small script that launches a container to let you bring in your favorite debugging or admin tools.
There are currently two scripts that live within this repository:
$ /usr/bin/toolbox Spawning container core-fedora-latest on /var/lib/toolbox/core-fedora-latest. Press ^] three times within 1s to kill container. [root@localhost ~]# dnf -y install tcpdump ... [root@localhost ~]# tcpdump -i ens3 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ens3, link-type EN10MB (Ethernet), capture size 65535 bytes
toolbox uses a Fedora-based userspace environment by default, but this can be changed to any Docker image. Simply override environment variables in $HOME/.toolboxrc
:
core@core-01 ~ $ cat ~/.toolboxrc TOOLBOX_DOCKER_IMAGE=ubuntu-debootstrap TOOLBOX_DOCKER_TAG=14.04 core@core-01 ~ $ toolbox Spawning container core-ubuntu-debootstrap-14.04 on /var/lib/toolbox/core-ubuntu-debootstrap-14.04. Press ^] three times within 1s to kill container. root@core-01:~# apt-get update && apt-get install tcpdump
core@core-01 ~ $ cat ~/.toolboxrc REGISTRY=registry.redhat.io IMAGE=rhel7/rhel-tools:latest core@core-01 ~ $ toolbox Spawning a container 'toolbox-test' with image 'registry.redhat.io/rhel7/rhel-tools:latest'
Set an /etc/passwd
entry for one of the users to /usr/bin/toolbox
:
useradd bob -m -p '*' -s /usr/bin/toolbox -U -G sudo,docker,rkt
Now when SSHing into the system as that user, toolbox will automatically be started:
$ ssh bob@hostname.example.com Container Linux by CoreOS alpha (1284.0.0) ... Spawning container bob-fedora-latest on /var/lib/toolbox/bob-fedora-latest. Press ^] three times within 1s to kill container. [root@localhost ~]# dnf -y install emacs-nox ... [root@localhost ~]# emacs /media/root/etc/systemd/system/docker.service