Skip to content

Instantly share code, notes, and snippets.

@res0nat0r
Last active March 2, 2024 08:37
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save res0nat0r/e182f23272a331f20b83195156eef83f to your computer and use it in GitHub Desktop.
Save res0nat0r/e182f23272a331f20b83195156eef83f to your computer and use it in GitHub Desktop.
Set proxy in Colima Docker container

abiosoft/colima#294 (comment)


Note: this assumes Colima v0.4.0 or newer.

SSH into the VM colima ssh

Edit docker init script sudo vi /etc/init.d/docker.

Append with the following:

set -o allexport
if [ -f /etc/environment ]; then source /etc/environment; fi
set +o allexport

Stop Colima colima stop

Set the environment variable in the Colima config.

colima start --edit or edit $HOME/.colima/default/colima.yaml

env:
  HTTP_PROXY: http://proxy.example.com:80
  HTTPS_PROXY: http://proxy.example.com:443
  NO_PROXY: localhost,127.0.0.1,docker-registry.example.com,.corp

Start Colima colima start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment