Skip to content

Commit

Permalink
docs: document the docker context support
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Oct 16, 2024
1 parent 14aa3dd commit b327978
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 157 deletions.
68 changes: 68 additions & 0 deletions docs/system_requirements/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,71 @@ However, these are not actively tested in the main development workflow, so not

If you have further questions about configuration details for your setup or whether it supports running Testcontainers-based tests,
please contact the Testcontainers team and other users from the Testcontainers community on [Slack](https://slack.testcontainers.org/).

## Using different container runtimes

_Testcontainers for Go_ automatically detects the selected Docker context and use it to run the tests on that container runtime. You can check the selected context by running:

```sh
docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ERROR
colima colima unix:///Users/mdelapenya/.colima/default/docker.sock
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * Docker Desktop unix:///Users/mdelapenya/.docker/run/docker.sock
orbstack OrbStack unix:///Users/mdelapenya/.orbstack/run/docker.sock
podman podman context unix:///var/folders/_j/nhbgdck523n3008dd3zlsm5m0000gn/T/podman/podman-machine-default-api.sock
tcd Testcontainers Desktop tcp://127.0.0.1:59908
```

It is possible to use any container runtime to satisfy the system requirements instead of Docker, as long as it is 100% Docker-API compatible, and a Docker context is created for it.

### Colima

Colima creates its own Docker context when it is installed. This context is called `colima`. You can set this as the active context by running:

```sh
docker context use colima
```

### Orbstack

Orbstack creates its own Docker context when it is installed. This context is called `orbstack`. You can set this as the active context by running:

```sh
docker context use orbstack
```

### Podman

Podman does not create its own Docker context when it is installed so, after starting a `podman-machine`, please create it with the following command:

```sh
docker context create podman --description "podman context" --docker "host=unix:///var/folders/_j/nhbgdck523n3008dd3zlsm5m0000gn/T/podman/podman-machine-default-api.sock"
```

!!! note
The UNIX socket path could be different in your machine. You can find it by running `podman machine inspect`.

Then you can set this as the active context by running:

```sh
docker context use podman
```

### Rancher Desktop

Rancher Desktop creates its own Docker context when it is installed. This context is called `rancher-desktop`. You can set this as the active context by running:

```sh
docker context use rancher-desktop
```

### Testcontainers Desktop

Testcontainers Desktop creates its own Docker context when it is installed. This context is called `tcd`. You can set this as the active context by running:

```sh
docker context use tcd
```

Testcontainers Desktop allows you to switch between different container runtimes, such as Docker, Podman, and Colima, by just using its simple GUI. You can also run the containers in the cloud, using Docker's Testcontainers Cloud.
26 changes: 0 additions & 26 deletions docs/system_requirements/rancher.md

This file was deleted.

47 changes: 0 additions & 47 deletions docs/system_requirements/using_colima.md

This file was deleted.

81 changes: 0 additions & 81 deletions docs/system_requirements/using_podman.md

This file was deleted.

3 changes: 0 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ nav:
- system_requirements/ci/gitlab_ci.md
- system_requirements/ci/tekton.md
- system_requirements/ci/travis.md
- system_requirements/using_colima.md
- system_requirements/using_podman.md
- system_requirements/rancher.md
- Contributing:
- contributing.md
- contributing_docs.md
Expand Down

0 comments on commit b327978

Please sign in to comment.