Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add docs regarding Colima usage #547

Merged
merged 1 commit into from Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/features/using_colima.md
@@ -0,0 +1,39 @@
# Using Colima with Docker

[Colima](https://github.com/abiosoft/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-go will automatically be
configured to use Colima.

```bash
$ 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.sock
```
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved

If you're using an older version of Colima or have other applications that are
unaware of Docker context the following workaround is available:

1. Locate your Docker Socket, see: [Colima's FAQ - Docker Socket Location](https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#docker-socket-location)

2. Set the `DOCKER_HOST` environment variable to match the located Docker Socket

* Example: `export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"`

3. As of testcontainers-go v0.14.0 set `TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE`
to `/var/run/docker.sock` as the default value refers to your `DOCKER_HOST`
environment variable.

* Example: `export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE="/var/run/docker.sock"`
1 change: 1 addition & 0 deletions mkdocs.yml
Expand Up @@ -37,6 +37,7 @@ nav:
- features/override_container_command.md
- features/copy_file.md
- features/using_podman.md
- features/using_colima.md
- Wait Strategies:
- Introduction: features/wait/introduction.md
- Exec: features/wait/exec.md
Expand Down