Quickstart
Using Colima with Docker
登录后可跨设备保存划线和私人笔记登录
Using Colima with Docker
Colima is a container runtime which integrates with Docker's tooling and can be configured in various ways.
As of Colima v0.4.0 it's recommended to set the active Docker context to use Colima. After the context is set Testcontainers for Go will automatically be configured to use Colima.
$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
colima colima unix:///Users/foobar/.colima/default/docker.sock
default * Current DOCKER_HOST based configuration unix:///Users/foobar/.colima/docker.sock
$ docker context use colima
colima
Current context is now "colima"
$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
colima * colima unix:///Users/foobar/.colima/default/docker.sock
default Current DOCKER_HOST based configuration unix:///var/run/docker.sockIf you're using an older version of Colima or have other applications that are unaware of Docker context the following workaround is available:
- Locate your Docker Socket, see: Colima's FAQ - Docker Socket Location
- Create a symbolic link from the default Docker Socket to the expected location, and restart Colima with the
--network-addressflag.
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
colima stop
colima start --network-addressSet the
DOCKER_HOSTenvironment variable to match the located Docker Socket- Example:
export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"
- Example:
As of testcontainers-go v0.14.0 set
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDEto/var/run/docker.sockas the default value refers to yourDOCKER_HOSTenvironment variable.- Example:
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE="/var/run/docker.sock"
- Example:
评论
登录后参与评论
正在加载评论…
KnowForge