commit | 934843e2440263989dd7c9e3f750e6106027165b | [log] [tgz] |
---|---|---|
author | Colin Walters <walters@verbum.org> | Tue Jan 31 14:02:00 2023 |
committer | GitHub <noreply@github.com> | Tue Jan 31 14:02:00 2023 |
tree | 0301d262b7d62c8d5f106275eeec2d902b81cac2 | |
parent | 44c782fcee900971e1d88c8eabcece664879400a [diff] | |
parent | 3c02d8ec084f9450df8cffba1835b4ae13fbb808 [diff] |
Merge pull request #82 from kenneth-dsouza/skopeo_fix rhcos-toolbox(skopeo): Pass env to sudo when required
rhcos-toolbox is a small script, designed for RHEL CoreOS, that launches a podman container to let you bring in your favorite debugging or admin tools.
$ /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 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