Skip to content

Commit

Permalink
Merge branch 'main' of github.com:testcontainers/testcontainers-node …
Browse files Browse the repository at this point in the history
…into 727-install-node-dependencies-action-are-not-taking-right-node-js-version
  • Loading branch information
javierlopezdeancos committed Mar 26, 2024
2 parents 2e60088 + 0488293 commit 265f729
Show file tree
Hide file tree
Showing 18 changed files with 1,625 additions and 385 deletions.
19 changes: 10 additions & 9 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ All possible environment variable configurations for Testcontainers are found he
## Logs

| Variable | Example | Description |
|----------|---------------------------|----------------------------|
| DEBUG | testcontainers* | Enable all logs |
| -------- | ------------------------- | -------------------------- |
| DEBUG | testcontainers\* | Enable all logs |
| DEBUG | testcontainers | Enable testcontainers logs |
| DEBUG | testcontainers:containers | Enable container logs |
| DEBUG | testcontainers:compose | Enable compose logs |
Expand All @@ -20,25 +20,26 @@ Note that you can enable multiple loggers, e.g: `DEBUG=testcontainers,testcontai

Configuration of the Docker daemon:

| Variable | Example | Description |
|--------------------|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| DOCKER_HOST | tcp://docker:2375 | Set the URL of the docker daemon |
| DOCKER_TLS_VERIFY | 1 | Enable/disable TLS communication with the docker daemon |
| DOCKER_CERT_PATH | /some/path | Configures the path to the files used for TLS verification |
| DOCKER_CONFIG | /some/path | Configures the path to the config.json file for authentication |
| Variable | Example | Description |
| ------------------ | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| DOCKER_HOST | tcp://docker:2375 | Set the URL of the docker daemon |
| DOCKER_TLS_VERIFY | 1 | Enable/disable TLS communication with the docker daemon |
| DOCKER_CERT_PATH | /some/path | Configures the path to the files used for TLS verification |
| DOCKER_CONFIG | /some/path | Configures the path to the config.json file for authentication |
| DOCKER_AUTH_CONFIG | `{"auths":{"https://registry.example.com":{"username":"","password":""}}}` | JSON string representation of the config.json file, takes precedence for authentication |

## Testcontainers

Configuration of Testcontainers and its behaviours:

| Variable | Example | Description |
|---------------------------------------|---------------------------|------------------------------------------|
| ------------------------------------- | ------------------------- | ---------------------------------------- |
| TESTCONTAINERS_HOST_OVERRIDE | tcp://docker:2375 | Docker's host on which ports are exposed |
| TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE | /var/run/docker.sock | Path to Docker's socket used by ryuk |
| TESTCONTAINERS_RYUK_PRIVILEGED | true | Run ryuk as a privileged container |
| TESTCONTAINERS_RYUK_DISABLED | true | Disable ryuk |
| TESTCONTAINERS_RYUK_PORT | 65515 | Set ryuk host port (not recommended) |
| TESTCONTAINERS_SSHD_PORT | 65515 | Set SSHd host port (not recommended) |
| TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX | mycompany.com/registry | Set default image registry |
| RYUK_CONTAINER_IMAGE | testcontainers/ryuk:0.5.1 | Custom image for ryuk |
| SSHD_CONTAINER_IMAGE | testcontainers/sshd:1.1.0 | Custom image for SSHd |
11 changes: 11 additions & 0 deletions docs/features/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ const container = await GenericContainer
.withCache(false)
.build();
```

## Image name substitution

Testcontainers supports automatic substitution of Docker image names.

This allows replacement of an image name specified in test code with an alternative name - for example, to replace the name of a Docker Hub image dependency with an alternative hosted on a private image registry.

This is advisable to avoid Docker Hub rate limiting, and some companies will prefer this for policy reasons.

You can then configure Testcontainers to apply the prefix `registry.mycompany.com/mirror/` to every image that it tries to pull from Docker Hub. This can be done by setting the environment variable `TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX=registry.mycompany.com/mirror/`.

28 changes: 28 additions & 0 deletions docs/modules/gcloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# GCloud Module

Testcontainers module for the Google Cloud Platform's [Cloud SDK](https://cloud.google.com/sdk/).

## Install

```bash
npm install @testcontainers/gcloud --save-dev
```


Currently, the module supports `Firestore` emulators. In order to use it, you should use the following classes:

Class | Container Image
-|-
FirestoreEmulatorContainer | [gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators](https://gcr.io/google.com/cloudsdktool/google-cloud-cli)

## Examples

### Firestore

<!--codeinclude-->
[Starting a Firestore Emulator container with the default image](../../packages/modules/gcloud/src/firestore-emulator-container.test.ts) inside_block:firestore4
<!--/codeinclude-->

<!--codeinclude-->
[Starting a Firestore Emulator container with a custom emulator image](../../packages/modules/gcloud/src/firestore-emulator-container.test.ts) inside_block:firestore5
<!--/codeinclude-->
4 changes: 4 additions & 0 deletions docs/modules/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ npm install @testcontainers/kafka --save-dev
<!--codeinclude-->
[Connect to Kafka using SSL:](../../packages/modules/kafka/src/kafka-container.test.ts) inside_block:ssl
<!--/codeinclude-->

<!--codeinclude-->
[Connect to Kafka using Kraft:](../../packages/modules/kafka/src/kafka-container.test.ts) inside_block:connectKraft
<!--/codeinclude-->
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nav:
- ArangoDB: modules/arangodb.md
#- Couchbase: modules/couchbase.md
- Elasticsearch: modules/elasticsearch.md
- GCloud: modules/gcloud.md
- HiveMQ: modules/hivemq.md
- Kafka: modules/kafka.md
- Localstack: modules/localstack.md
Expand Down
Loading

0 comments on commit 265f729

Please sign in to comment.