Skip to content

Instantly share code, notes, and snippets.

@res0nat0r
Last active September 24, 2024 02:08
Show Gist options
  • 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