commit | 7b4c0d34cf56f99d5287d939e96f786e2e1421a7 | [log] [tgz] |
---|---|---|
author | Nandhini Rengaraj <nrengaraj@google.com> | Tue Mar 07 23:11:48 2023 +0000 |
committer | Nandhini Rengaraj <nrengaraj@google.com> | Thu Mar 09 18:14:09 2023 +0000 |
tree | ec8317ffe5c6a5a831d0e76068589630552191f4 | |
parent | c9efb0c1d5a96383bf4037309fc0dda914a28b39 [diff] |
Make toolbox compatible with AR and GCR Currently, toolbox only pulls images from GCR. To be able to pull from AR, we regex match on AR host eg.us-central1-docker.pkg.dev and identify the corresponding registry host. docker-credential-gcr needs to be run before using toolbox. BUG=b/267813765 TEST=Tested locally by copying the script to a COS VM. RELEASE_NOTE=Make toolbox compatible with AR and GCR Change-Id: Ib2981d081e8efbe74fb0ea59920b7f0cfe19582d
toolbox is a small script that launches a 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. -bash-4.3# yum install tcpdump ... -bash-4.3# 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
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
Now when SSHing into the system as that user, toolbox will automatically be started:
$ ssh bob@hostname.example.com CoreOS alpha (633.1.0) ... Spawning container core-fedora-latest on /var/lib/toolbox/core-fedora-latest. -bash-4.3 # yum install emacs -bash-4.3 # emacs /media/root/etc/systemd/system/docker.service
Please use the CoreOS issue tracker to report all bugs, issues, and feature requests.