Skip to content

Commit 55a9f77

Browse files
committed
docs(main): Private registry
1 parent 54c88cf commit 55a9f77

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

index.rst

+33-11
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,42 @@ When trying to launch a testcontainer from within a Docker container, e.g., in c
103103
1. The container has to provide a docker client installation. Either use an image that has docker pre-installed (e.g. the `official docker images <https://hub.docker.com/_/docker>`_) or install the client from within the `Dockerfile` specification.
104104
2. The container has to have access to the docker daemon which can be achieved by mounting `/var/run/docker.sock` or setting the `DOCKER_HOST` environment variable as part of your `docker run` command.
105105

106+
Private Docker registry
107+
-----------------------
108+
109+
Using a private docker registry requires the `DOCKER_AUTH_CONFIG` environment variable to be set. `official documentation <https://docs.docker.com/engine/reference/commandline/login/#credential-helpers>`
110+
111+
The value of this variable should be a JSON string containing the authentication information for the registry.
112+
113+
In order to generate the JSON string, you can use the following command:
114+
``echo -n '{"auths": {"<url>": {"auth": "'$(echo -n "<username>:<password>" | base64 -w 0)'"}}}'``
115+
116+
Example:
117+
``DOCKER_AUTH_CONFIG='{"auths": {"https://myregistry.com": {"auth": "dXNlcm5hbWU6cGFzc3dvcmQ="}}}'``
118+
119+
Fetching passwords from cloud providers:
120+
- ``ECR_PASSWORD = $(aws ecr get-login-password --region eu-west-1)``
121+
- ``GCP_PASSWORD = $(gcloud auth print-access-token)``
122+
- ``AZURE_PASSWORD = $(az acr login --name <registry-name> --expose-token --output tsv)``
123+
124+
125+
106126
Configuration
107127
-------------
108128

109-
+-------------------------------------------+-------------------------------+------------------------------------------+
110-
| Env Variable | Example | Description |
111-
+===========================================+===============================+==========================================+
112-
| ``TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE`` | ``/var/run/docker.sock`` | Path to Docker's socket used by ryuk |
113-
+-------------------------------------------+-------------------------------+------------------------------------------+
114-
| ``TESTCONTAINERS_RYUK_PRIVILEGED`` | ``false`` | Run ryuk as a privileged container |
115-
+-------------------------------------------+-------------------------------+------------------------------------------+
116-
| ``TESTCONTAINERS_RYUK_DISABLED`` | ``false`` | Disable ryuk |
117-
+-------------------------------------------+-------------------------------+------------------------------------------+
118-
| ``RYUK_CONTAINER_IMAGE`` | ``testcontainers/ryuk:0.7.0`` | Custom image for ryuk |
119-
+-------------------------------------------+-------------------------------+------------------------------------------+
129+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
130+
| Env Variable | Example | Description |
131+
+===========================================+===================================================+==========================================+
132+
| ``TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE`` | ``/var/run/docker.sock`` | Path to Docker's socket used by ryuk |
133+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
134+
| ``TESTCONTAINERS_RYUK_PRIVILEGED`` | ``false`` | Run ryuk as a privileged container |
135+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
136+
| ``TESTCONTAINERS_RYUK_DISABLED`` | ``false`` | Disable ryuk |
137+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
138+
| ``RYUK_CONTAINER_IMAGE`` | ``testcontainers/ryuk:0.7.0`` | Custom image for ryuk |
139+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
140+
| ``DOCKER_AUTH_CONFIG`` | ``{"auths": {"<url>": {"auth": "<encoded>"}}}`` | Custom registry auth config |
141+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
120142

121143
Development and Contributing
122144
----------------------------

0 commit comments

Comments
 (0)