diff --git a/test/README.md b/test/README.md index b2a6d4a..7a4610b 100644 --- a/test/README.md +++ b/test/README.md @@ -41,6 +41,15 @@ IMAGE_TAG=v2.30.0 ./test.sh By default, two local images are created that persist the image data and provide it to containers at runtime. +#### `DOCKER_CONFIG_FILE` + +By default, the sandbox uses an empty Docker config file (`./docker-config.json`). +To use host credentials (e.g. in CI), set `DOCKER_CONFIG_FILE` to the desired `config.json` location: + +```sh +DOCKER_CONFIG_FILE=${HOME}/.docker/config.json ./test.sh +``` + ## Understanding the test setup The test setup runs each test case in an isolated Docker container, which itself is running an otherwise unused Docker daemon. diff --git a/test/docker-compose.yml b/test/docker-compose.yml index eb4445b..5ebdea3 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -10,7 +10,7 @@ services: retries: 50 volumes: - ./:/code - - ${HOME}/.docker/config.json:/root/.docker/config.json + - ${DOCKER_CONFIG_FILE:-./docker-config.json}:/root/.docker/config.json - ${TARBALL:-.}:/cache/image.tar.gz - docker_volume_backup_test_sandbox_image:/var/lib/docker/image - docker_volume_backup_test_sandbox_containerd:/var/lib/docker/containerd @@ -20,7 +20,7 @@ services: hostname: worker1 volumes: - ./:/code - - ${HOME}/.docker/config.json:/root/.docker/config.json + - ${DOCKER_CONFIG_FILE:-./docker-config.json}:/root/.docker/config.json - ${TARBALL:-.}:/cache/image.tar.gz - docker_volume_backup_test_sandbox_image:/var/lib/docker/image - docker_volume_backup_test_sandbox_containerd_1:/var/lib/docker/containerd @@ -31,7 +31,7 @@ services: hostname: worker2 volumes: - ./:/code - - ${HOME}/.docker/config.json:/root/.docker/config.json + - ${DOCKER_CONFIG_FILE:-./docker-config.json}:/root/.docker/config.json - ${TARBALL:-.}:/cache/image.tar.gz - docker_volume_backup_test_sandbox_image:/var/lib/docker/image - docker_volume_backup_test_sandbox_containerd_2:/var/lib/docker/containerd diff --git a/test/docker-config.json b/test/docker-config.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/test/docker-config.json @@ -0,0 +1 @@ +{}