commit | 9e4e29effe736c5e93079f9ac6362bb221fea38b | [log] [tgz] |
---|---|---|
author | Rayan Dasoriya <dasoriya@google.com> | Wed Feb 23 18:32:09 2022 +0000 |
committer | Rayan Dasoriya <dasoriya@google.com> | Wed Mar 02 21:17:41 2022 +0000 |
tree | 43b8850f8e2843a9568b513a600dc2fd3c3747c9 | |
parent | 064f18a2641914bb3973ea865b6936f662022248 [diff] |
Fetch toolbox container image from multi-region AR As a part of migrating from Container Registry to Artifact Registry on GCP, we are also adding multi-region support which will enable fetching the container image from the respective instance zone. BUG=b/155525166 TEST=manually tested on VM RELEASE_NOTE=Fetch toolbox container image from multi-region Artifact Registry Change-Id: I8f6291543ee53930feae331d975e22bd33cf43bd
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.