testcontainers 9.12.0 → 10.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/src → build/common}/clock.js +1 -0
- package/build/common/clock.js.map +1 -0
- package/build/common/file-lock.js +58 -0
- package/build/common/file-lock.js.map +1 -0
- package/build/common/hash.d.ts +1 -0
- package/{dist/src → build/common}/hash.js +3 -2
- package/build/common/hash.js.map +1 -0
- package/build/common/index.d.ts +7 -0
- package/build/common/index.js +37 -0
- package/build/common/index.js.map +1 -0
- package/{dist/src → build/common}/logger.d.ts +5 -6
- package/{dist/src → build/common}/logger.js +5 -2
- package/build/common/logger.js.map +1 -0
- package/{dist/src/retry-strategy.d.ts → build/common/retry.d.ts} +3 -3
- package/build/common/retry.js +38 -0
- package/build/common/retry.js.map +1 -0
- package/build/common/streams.js +13 -0
- package/build/common/streams.js.map +1 -0
- package/{dist/src → build/common}/type-guards.js +1 -0
- package/build/common/type-guards.js.map +1 -0
- package/{dist/src → build/common}/uuid.js +1 -0
- package/build/common/uuid.js.map +1 -0
- package/build/container-runtime/auth/auths.d.ts +7 -0
- package/build/container-runtime/auth/auths.js +45 -0
- package/build/container-runtime/auth/auths.js.map +1 -0
- package/build/container-runtime/auth/cred-helpers.d.ts +6 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/cred-helpers.js +1 -0
- package/build/container-runtime/auth/cred-helpers.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/credential-provider.d.ts +3 -4
- package/build/container-runtime/auth/credential-provider.js +71 -0
- package/build/container-runtime/auth/credential-provider.js.map +1 -0
- package/build/container-runtime/auth/creds-store.d.ts +6 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/creds-store.js +1 -0
- package/build/container-runtime/auth/creds-store.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/get-auth-config.d.ts +1 -1
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/get-auth-config.js +11 -19
- package/build/container-runtime/auth/get-auth-config.js.map +1 -0
- package/build/container-runtime/auth/registry-auth-locator.d.ts +5 -0
- package/build/container-runtime/auth/registry-auth-locator.js +3 -0
- package/build/container-runtime/auth/registry-auth-locator.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/registry-matches.js +1 -0
- package/build/container-runtime/auth/registry-matches.js.map +1 -0
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/types.d.ts +13 -1
- package/{dist/src/registry-auth-locator → build/container-runtime/auth}/types.js +1 -0
- package/build/container-runtime/auth/types.js.map +1 -0
- package/build/container-runtime/clients/client.d.ts +14 -0
- package/build/container-runtime/clients/client.js +105 -0
- package/build/container-runtime/clients/client.js.map +1 -0
- package/build/container-runtime/clients/compose/compose-client.d.ts +11 -0
- package/build/container-runtime/clients/compose/compose-client.js +238 -0
- package/build/container-runtime/clients/compose/compose-client.js.map +1 -0
- package/build/container-runtime/clients/compose/default-compose-options.d.ts +4 -0
- package/build/container-runtime/clients/compose/default-compose-options.js +31 -0
- package/build/container-runtime/clients/compose/default-compose-options.js.map +1 -0
- package/build/container-runtime/clients/compose/parse-compose-container-name.d.ts +1 -0
- package/{dist/src/docker-compose/container-name-resolver.js → build/container-runtime/clients/compose/parse-compose-container-name.js} +5 -4
- package/build/container-runtime/clients/compose/parse-compose-container-name.js.map +1 -0
- package/build/container-runtime/clients/compose/types.d.ts +15 -0
- package/{dist/src/docker → build/container-runtime/clients/compose}/types.js +1 -0
- package/build/container-runtime/clients/compose/types.js.map +1 -0
- package/build/container-runtime/clients/container/container-client.d.ts +32 -0
- package/build/container-runtime/clients/container/container-client.js +3 -0
- package/build/container-runtime/clients/container/container-client.js.map +1 -0
- package/build/container-runtime/clients/container/docker-container-client.d.ts +35 -0
- package/build/container-runtime/clients/container/docker-container-client.js +276 -0
- package/build/container-runtime/clients/container/docker-container-client.js.map +1 -0
- package/build/container-runtime/clients/container/podman-container-client.d.ts +8 -0
- package/build/container-runtime/clients/container/podman-container-client.js +43 -0
- package/build/container-runtime/clients/container/podman-container-client.js.map +1 -0
- package/build/container-runtime/clients/container/types.d.ts +4 -0
- package/{dist/src/docker/client/docker-client-types.js → build/container-runtime/clients/container/types.js} +1 -0
- package/build/container-runtime/clients/container/types.js.map +1 -0
- package/build/container-runtime/clients/image/docker-image-client.d.ts +16 -0
- package/build/container-runtime/clients/image/docker-image-client.js +119 -0
- package/build/container-runtime/clients/image/docker-image-client.js.map +1 -0
- package/build/container-runtime/clients/image/image-client.d.ts +9 -0
- package/build/container-runtime/clients/image/image-client.js +3 -0
- package/build/container-runtime/clients/image/image-client.js.map +1 -0
- package/build/container-runtime/clients/network/docker-network-client.d.ts +9 -0
- package/build/container-runtime/clients/network/docker-network-client.js +50 -0
- package/build/container-runtime/clients/network/docker-network-client.js.map +1 -0
- package/build/container-runtime/clients/network/network-client.d.ts +6 -0
- package/build/container-runtime/clients/network/network-client.js +3 -0
- package/build/container-runtime/clients/network/network-client.js.map +1 -0
- package/build/container-runtime/clients/types.d.ts +30 -0
- package/{dist/src/docker/client/strategy/docker-client-strategy.js → build/container-runtime/clients/types.js} +1 -0
- package/build/container-runtime/clients/types.js.map +1 -0
- package/build/container-runtime/image-name.d.ts +11 -0
- package/{dist/src/docker-image-name.js → build/container-runtime/image-name.js} +11 -17
- package/build/container-runtime/image-name.js.map +1 -0
- package/build/container-runtime/index.d.ts +6 -0
- package/build/container-runtime/index.js +13 -0
- package/build/container-runtime/index.js.map +1 -0
- package/build/container-runtime/strategies/configuration-strategy.d.ts +9 -0
- package/build/container-runtime/strategies/configuration-strategy.js +53 -0
- package/build/container-runtime/strategies/configuration-strategy.js.map +1 -0
- package/build/container-runtime/strategies/npipe-socket-strategy.d.ts +6 -0
- package/build/container-runtime/strategies/npipe-socket-strategy.js +21 -0
- package/build/container-runtime/strategies/npipe-socket-strategy.js.map +1 -0
- package/build/container-runtime/strategies/rootless-unix-socket-strategy.d.ts +14 -0
- package/build/container-runtime/strategies/rootless-unix-socket-strategy.js +63 -0
- package/build/container-runtime/strategies/rootless-unix-socket-strategy.js.map +1 -0
- package/build/container-runtime/strategies/strategy.d.ts +5 -0
- package/{dist/src/registry-auth-locator/registry-auth-locator.js → build/container-runtime/strategies/strategy.js} +1 -0
- package/build/container-runtime/strategies/strategy.js.map +1 -0
- package/build/container-runtime/strategies/testcontainers-host-strategy.d.ts +6 -0
- package/build/container-runtime/strategies/testcontainers-host-strategy.js +30 -0
- package/build/container-runtime/strategies/testcontainers-host-strategy.js.map +1 -0
- package/build/container-runtime/strategies/types.d.ts +8 -0
- package/build/container-runtime/strategies/types.js +3 -0
- package/build/container-runtime/strategies/types.js.map +1 -0
- package/build/container-runtime/strategies/unix-socket-strategy.d.ts +6 -0
- package/build/container-runtime/strategies/unix-socket-strategy.js +22 -0
- package/build/container-runtime/strategies/unix-socket-strategy.js.map +1 -0
- package/build/container-runtime/strategies/utils/config.d.ts +9 -0
- package/build/container-runtime/strategies/utils/config.js +75 -0
- package/build/container-runtime/strategies/utils/config.js.map +1 -0
- package/build/container-runtime/utils/attach-container.js +17 -0
- package/build/container-runtime/utils/attach-container.js.map +1 -0
- package/build/container-runtime/utils/demux-stream.d.ts +4 -0
- package/build/container-runtime/utils/demux-stream.js +24 -0
- package/build/container-runtime/utils/demux-stream.js.map +1 -0
- package/build/container-runtime/utils/image-exists.d.ts +3 -0
- package/build/container-runtime/utils/image-exists.js +29 -0
- package/build/container-runtime/utils/image-exists.js.map +1 -0
- package/build/container-runtime/utils/lookup-host-ips.d.ts +2 -0
- package/build/container-runtime/utils/lookup-host-ips.js +18 -0
- package/build/container-runtime/utils/lookup-host-ips.js.map +1 -0
- package/{dist/src/docker/functions/image → build/container-runtime/utils}/pull-image.d.ts +2 -2
- package/build/container-runtime/utils/pull-image.js +35 -0
- package/build/container-runtime/utils/pull-image.js.map +1 -0
- package/build/container-runtime/utils/remote-container-runtime-socket-path.d.ts +7 -0
- package/build/container-runtime/utils/remote-container-runtime-socket-path.js +23 -0
- package/build/container-runtime/utils/remote-container-runtime-socket-path.js.map +1 -0
- package/build/container-runtime/utils/resolve-host.d.ts +8 -0
- package/build/container-runtime/utils/resolve-host.js +54 -0
- package/build/container-runtime/utils/resolve-host.js.map +1 -0
- package/build/container-runtime/utils/run-in-container.js +30 -0
- package/build/container-runtime/utils/run-in-container.js.map +1 -0
- package/build/container-runtime/utils/start-container.js +15 -0
- package/build/container-runtime/utils/start-container.js.map +1 -0
- package/{dist/src → build}/docker-compose-environment/docker-compose-environment.d.ts +5 -5
- package/build/docker-compose-environment/docker-compose-environment.js +144 -0
- package/build/docker-compose-environment/docker-compose-environment.js.map +1 -0
- package/{dist/src → build}/docker-compose-environment/downed-docker-compose-environment.js +1 -0
- package/build/docker-compose-environment/downed-docker-compose-environment.js.map +1 -0
- package/{dist/src → build}/docker-compose-environment/started-docker-compose-environment.d.ts +3 -3
- package/build/docker-compose-environment/started-docker-compose-environment.js +37 -0
- package/build/docker-compose-environment/started-docker-compose-environment.js.map +1 -0
- package/build/docker-compose-environment/stopped-docker-compose-environment.d.ts +7 -0
- package/build/docker-compose-environment/stopped-docker-compose-environment.js +19 -0
- package/build/docker-compose-environment/stopped-docker-compose-environment.js.map +1 -0
- package/{dist/src/modules → build/generic-container}/abstract-started-container.d.ts +1 -1
- package/build/generic-container/abstract-started-container.js +69 -0
- package/build/generic-container/abstract-started-container.js.map +1 -0
- package/{dist/src/modules → build/generic-container}/abstract-stopped-container.js +2 -0
- package/build/generic-container/abstract-stopped-container.js.map +1 -0
- package/{dist/src → build}/generic-container/generic-container-builder.d.ts +4 -4
- package/build/generic-container/generic-container-builder.js +87 -0
- package/build/generic-container/generic-container-builder.js.map +1 -0
- package/{dist/src → build}/generic-container/generic-container.d.ts +18 -22
- package/build/generic-container/generic-container.js +350 -0
- package/build/generic-container/generic-container.js.map +1 -0
- package/{dist/src → build}/generic-container/started-generic-container.d.ts +6 -6
- package/build/generic-container/started-generic-container.js +161 -0
- package/build/generic-container/started-generic-container.js.map +1 -0
- package/build/generic-container/stopped-generic-container.js +23 -0
- package/build/generic-container/stopped-generic-container.js.map +1 -0
- package/build/index.d.ts +16 -0
- package/build/index.js +35 -0
- package/build/index.js.map +1 -0
- package/build/network/network.d.ts +19 -0
- package/build/network/network.js +61 -0
- package/build/network/network.js.map +1 -0
- package/{dist/src → build/port-forwarder}/port-forwarder.d.ts +2 -1
- package/build/port-forwarder/port-forwarder.js +73 -0
- package/build/port-forwarder/port-forwarder.js.map +1 -0
- package/build/reaper/reaper.d.ts +8 -0
- package/build/reaper/reaper.js +119 -0
- package/build/reaper/reaper.js.map +1 -0
- package/{dist/src → build}/test-container.d.ts +6 -6
- package/{dist/src → build}/test-container.js +1 -0
- package/build/test-container.js.map +1 -0
- package/build/test-containers.js +12 -0
- package/build/test-containers.js.map +1 -0
- package/{dist/src/docker → build}/types.d.ts +16 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/{dist/src → build/utils}/bound-ports.d.ts +4 -3
- package/{dist/src → build/utils}/bound-ports.js +22 -5
- package/build/utils/bound-ports.js.map +1 -0
- package/build/utils/dockerfile-parser.d.ts +3 -0
- package/build/utils/dockerfile-parser.js +28 -0
- package/build/utils/dockerfile-parser.js.map +1 -0
- package/{dist/src → build/utils}/labels.d.ts +1 -0
- package/build/utils/labels.js +18 -0
- package/build/utils/labels.js.map +1 -0
- package/build/utils/map-inspect-result.d.ts +3 -0
- package/build/utils/map-inspect-result.js +55 -0
- package/build/utils/map-inspect-result.js.map +1 -0
- package/build/utils/port-generator.js +43 -0
- package/build/utils/port-generator.js.map +1 -0
- package/{dist/src → build/utils}/port.d.ts +0 -3
- package/build/utils/port.js +10 -0
- package/build/utils/port.js.map +1 -0
- package/build/utils/pull-policy.d.ts +7 -0
- package/build/utils/pull-policy.js +23 -0
- package/build/utils/pull-policy.js.map +1 -0
- package/build/utils/test-helper.d.ts +19 -0
- package/build/utils/test-helper.js +107 -0
- package/build/utils/test-helper.js.map +1 -0
- package/build/version.d.ts +1 -0
- package/build/version.js +5 -0
- package/build/version.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/composite-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/composite-wait-strategy.js +49 -0
- package/build/wait-strategies/composite-wait-strategy.js.map +1 -0
- package/build/wait-strategies/health-check-wait-strategy.js +26 -0
- package/build/wait-strategies/health-check-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/host-port-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/host-port-wait-strategy.js +42 -0
- package/build/wait-strategies/host-port-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/http-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/http-wait-strategy.js +111 -0
- package/build/wait-strategies/http-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/log-wait-strategy.d.ts +1 -1
- package/build/wait-strategies/log-wait-strategy.js +62 -0
- package/build/wait-strategies/log-wait-strategy.js.map +1 -0
- package/build/wait-strategies/shell-wait-strategy.js +30 -0
- package/build/wait-strategies/shell-wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/startup-check-strategy.d.ts +3 -0
- package/build/wait-strategies/startup-check-strategy.js +27 -0
- package/build/wait-strategies/startup-check-strategy.js.map +1 -0
- package/{dist/src → build/wait-strategies/utils}/port-check.d.ts +5 -6
- package/build/wait-strategies/utils/port-check.js +81 -0
- package/build/wait-strategies/utils/port-check.js.map +1 -0
- package/build/wait-strategies/wait-for-container.d.ts +5 -0
- package/build/wait-strategies/wait-for-container.js +24 -0
- package/build/wait-strategies/wait-for-container.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/wait-strategy.d.ts +1 -1
- package/{dist/src/wait-strategy → build/wait-strategies}/wait-strategy.js +3 -4
- package/build/wait-strategies/wait-strategy.js.map +1 -0
- package/{dist/src/wait-strategy → build/wait-strategies}/wait.js +1 -0
- package/build/wait-strategies/wait.js.map +1 -0
- package/package.json +18 -63
- package/LICENSE +0 -21
- package/README.md +0 -27
- package/dist/package.json +0 -104
- package/dist/src/docker/client/docker-client-config.d.ts +0 -9
- package/dist/src/docker/client/docker-client-config.js +0 -82
- package/dist/src/docker/client/docker-client-types.d.ts +0 -23
- package/dist/src/docker/client/docker-client.d.ts +0 -2
- package/dist/src/docker/client/docker-client.js +0 -133
- package/dist/src/docker/client/strategy/configuration-strategy.d.ts +0 -11
- package/dist/src/docker/client/strategy/configuration-strategy.js +0 -66
- package/dist/src/docker/client/strategy/docker-client-strategy.d.ts +0 -7
- package/dist/src/docker/client/strategy/npipe-socket-strategy.d.ts +0 -7
- package/dist/src/docker/client/strategy/npipe-socket-strategy.js +0 -31
- package/dist/src/docker/client/strategy/rootless-unix-socket-strategy.d.ts +0 -18
- package/dist/src/docker/client/strategy/rootless-unix-socket-strategy.js +0 -77
- package/dist/src/docker/client/strategy/testcontainers-host-strategy.d.ts +0 -9
- package/dist/src/docker/client/strategy/testcontainers-host-strategy.js +0 -47
- package/dist/src/docker/client/strategy/unix-socket-strategy.d.ts +0 -7
- package/dist/src/docker/client/strategy/unix-socket-strategy.js +0 -32
- package/dist/src/docker/functions/container/attach-container.js +0 -25
- package/dist/src/docker/functions/container/container-logs.d.ts +0 -6
- package/dist/src/docker/functions/container/container-logs.js +0 -32
- package/dist/src/docker/functions/container/create-container.d.ts +0 -31
- package/dist/src/docker/functions/container/create-container.js +0 -117
- package/dist/src/docker/functions/container/exec-container.d.ts +0 -3
- package/dist/src/docker/functions/container/exec-container.js +0 -66
- package/dist/src/docker/functions/container/get-container-archive.d.ts +0 -11
- package/dist/src/docker/functions/container/get-container-archive.js +0 -23
- package/dist/src/docker/functions/container/get-container.d.ts +0 -3
- package/dist/src/docker/functions/container/get-container.js +0 -49
- package/dist/src/docker/functions/container/inspect-container.d.ts +0 -19
- package/dist/src/docker/functions/container/inspect-container.js +0 -67
- package/dist/src/docker/functions/container/list-containers.d.ts +0 -2
- package/dist/src/docker/functions/container/list-containers.js +0 -25
- package/dist/src/docker/functions/container/put-container-archive.d.ts +0 -9
- package/dist/src/docker/functions/container/put-container-archive.js +0 -26
- package/dist/src/docker/functions/container/remove-container.d.ts +0 -5
- package/dist/src/docker/functions/container/remove-container.js +0 -23
- package/dist/src/docker/functions/container/restart-container.d.ts +0 -5
- package/dist/src/docker/functions/container/restart-container.js +0 -23
- package/dist/src/docker/functions/container/start-container.js +0 -23
- package/dist/src/docker/functions/container/stop-container.d.ts +0 -5
- package/dist/src/docker/functions/container/stop-container.js +0 -29
- package/dist/src/docker/functions/create-labels.d.ts +0 -2
- package/dist/src/docker/functions/create-labels.js +0 -13
- package/dist/src/docker/functions/demux-stream.d.ts +0 -3
- package/dist/src/docker/functions/demux-stream.js +0 -32
- package/dist/src/docker/functions/get-info.d.ts +0 -11
- package/dist/src/docker/functions/get-info.js +0 -38
- package/dist/src/docker/functions/image/build-image.d.ts +0 -14
- package/dist/src/docker/functions/image/build-image.js +0 -81
- package/dist/src/docker/functions/image/image-exists.d.ts +0 -3
- package/dist/src/docker/functions/image/image-exists.js +0 -37
- package/dist/src/docker/functions/image/pull-image.js +0 -48
- package/dist/src/docker/functions/network/connect-network.d.ts +0 -6
- package/dist/src/docker/functions/network/connect-network.js +0 -28
- package/dist/src/docker/functions/network/create-network.d.ts +0 -16
- package/dist/src/docker/functions/network/create-network.js +0 -39
- package/dist/src/docker/functions/network/remove-network.d.ts +0 -1
- package/dist/src/docker/functions/network/remove-network.js +0 -31
- package/dist/src/docker/functions/run-in-container.js +0 -39
- package/dist/src/docker/lookup-host-ips.d.ts +0 -5
- package/dist/src/docker/lookup-host-ips.js +0 -26
- package/dist/src/docker/remote-docker-unix-socket-path.d.ts +0 -7
- package/dist/src/docker/remote-docker-unix-socket-path.js +0 -22
- package/dist/src/docker/resolve-host.d.ts +0 -8
- package/dist/src/docker/resolve-host.js +0 -63
- package/dist/src/docker-compose/container-name-resolver.d.ts +0 -1
- package/dist/src/docker-compose/docker-compose-client.d.ts +0 -9
- package/dist/src/docker-compose/docker-compose-client.js +0 -221
- package/dist/src/docker-compose/docker-compose-options.d.ts +0 -17
- package/dist/src/docker-compose/docker-compose-options.js +0 -51
- package/dist/src/docker-compose-environment/docker-compose-environment.js +0 -146
- package/dist/src/docker-compose-environment/started-docker-compose-environment.js +0 -47
- package/dist/src/docker-compose-environment/stopped-docker-compose-environment.d.ts +0 -7
- package/dist/src/docker-compose-environment/stopped-docker-compose-environment.js +0 -28
- package/dist/src/docker-image-name.d.ts +0 -15
- package/dist/src/dockerfile-parser.d.ts +0 -3
- package/dist/src/dockerfile-parser.js +0 -39
- package/dist/src/file-lock.js +0 -47
- package/dist/src/generic-container/create-container-options.d.ts +0 -3
- package/dist/src/generic-container/create-container-options.js +0 -18
- package/dist/src/generic-container/generic-container-builder.js +0 -97
- package/dist/src/generic-container/generic-container.js +0 -329
- package/dist/src/generic-container/started-generic-container.js +0 -168
- package/dist/src/generic-container/stopped-generic-container.js +0 -20
- package/dist/src/hash.d.ts +0 -1
- package/dist/src/images.d.ts +0 -2
- package/dist/src/images.js +0 -6
- package/dist/src/index.d.ts +0 -25
- package/dist/src/index.js +0 -66
- package/dist/src/labels.js +0 -8
- package/dist/src/modules/abstract-started-container.js +0 -86
- package/dist/src/modules/arangodb/arangodb-container.d.ts +0 -19
- package/dist/src/modules/arangodb/arangodb-container.js +0 -60
- package/dist/src/modules/elasticsearch/elasticsearch-container.d.ts +0 -12
- package/dist/src/modules/elasticsearch/elasticsearch-container.js +0 -49
- package/dist/src/modules/hivemq/hivemq-container.d.ts +0 -15
- package/dist/src/modules/hivemq/hivemq-container.js +0 -79
- package/dist/src/modules/kafka/kafka-container.d.ts +0 -45
- package/dist/src/modules/kafka/kafka-container.js +0 -177
- package/dist/src/modules/mongodb/mongodb-container.d.ts +0 -19
- package/dist/src/modules/mongodb/mongodb-container.js +0 -85
- package/dist/src/modules/mysql/mysql-container.d.ts +0 -30
- package/dist/src/modules/mysql/mysql-container.js +0 -111
- package/dist/src/modules/nats/nats-container.d.ts +0 -55
- package/dist/src/modules/nats/nats-container.js +0 -99
- package/dist/src/modules/neo4j/neo4j-container.d.ts +0 -23
- package/dist/src/modules/neo4j/neo4j-container.js +0 -82
- package/dist/src/modules/postgresql/postgresql-container.d.ts +0 -28
- package/dist/src/modules/postgresql/postgresql-container.js +0 -87
- package/dist/src/modules/selenium/selenium-container.d.ts +0 -38
- package/dist/src/modules/selenium/selenium-container.js +0 -161
- package/dist/src/network.d.ts +0 -18
- package/dist/src/network.js +0 -60
- package/dist/src/port-check.js +0 -90
- package/dist/src/port-forwarder.js +0 -83
- package/dist/src/port-generator.js +0 -51
- package/dist/src/port.js +0 -47
- package/dist/src/pull-policy.d.ts +0 -9
- package/dist/src/pull-policy.js +0 -15
- package/dist/src/reaper.d.ts +0 -5
- package/dist/src/reaper.js +0 -157
- package/dist/src/registry-auth-locator/auths.d.ts +0 -8
- package/dist/src/registry-auth-locator/auths.js +0 -56
- package/dist/src/registry-auth-locator/cred-helpers.d.ts +0 -6
- package/dist/src/registry-auth-locator/credential-provider.js +0 -81
- package/dist/src/registry-auth-locator/creds-store.d.ts +0 -6
- package/dist/src/registry-auth-locator/registry-auth-locator.d.ts +0 -6
- package/dist/src/retry-strategy.js +0 -46
- package/dist/src/stream-utils.js +0 -46
- package/dist/src/system-info.d.ts +0 -19
- package/dist/src/system-info.js +0 -80
- package/dist/src/test-containers.js +0 -22
- package/dist/src/wait-for-container.d.ts +0 -4
- package/dist/src/wait-for-container.js +0 -34
- package/dist/src/wait-strategy/composite-wait-strategy.js +0 -57
- package/dist/src/wait-strategy/health-check-wait-strategy.js +0 -36
- package/dist/src/wait-strategy/host-port-wait-strategy.js +0 -59
- package/dist/src/wait-strategy/http-wait-strategy.js +0 -120
- package/dist/src/wait-strategy/log-wait-strategy.js +0 -69
- package/dist/src/wait-strategy/shell-wait-strategy.js +0 -39
- package/dist/src/wait-strategy/startup-check-strategy.js +0 -35
- /package/{dist/src → build/common}/clock.d.ts +0 -0
- /package/{dist/src → build/common}/file-lock.d.ts +0 -0
- /package/{dist/src/stream-utils.d.ts → build/common/streams.d.ts} +0 -0
- /package/{dist/src → build/common}/type-guards.d.ts +0 -0
- /package/{dist/src → build/common}/uuid.d.ts +0 -0
- /package/{dist/src/registry-auth-locator → build/container-runtime/auth}/registry-matches.d.ts +0 -0
- /package/{dist/src/docker/functions/container → build/container-runtime/utils}/attach-container.d.ts +0 -0
- /package/{dist/src/docker/functions → build/container-runtime/utils}/run-in-container.d.ts +0 -0
- /package/{dist/src/docker/functions/container → build/container-runtime/utils}/start-container.d.ts +0 -0
- /package/{dist/src → build}/docker-compose-environment/downed-docker-compose-environment.d.ts +0 -0
- /package/{dist/src/modules → build/generic-container}/abstract-stopped-container.d.ts +0 -0
- /package/{dist/src → build}/generic-container/stopped-generic-container.d.ts +0 -0
- /package/{dist/src → build}/test-containers.d.ts +0 -0
- /package/{dist/src → build/utils}/port-generator.d.ts +0 -0
- /package/{dist/src/wait-strategy → build/wait-strategies}/health-check-wait-strategy.d.ts +0 -0
- /package/{dist/src/wait-strategy → build/wait-strategies}/shell-wait-strategy.d.ts +0 -0
- /package/{dist/src/wait-strategy → build/wait-strategies}/wait.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testcontainers",
|
|
3
|
+
"version": "10.0.0-beta.5",
|
|
4
|
+
"license": "MIT",
|
|
3
5
|
"author": "Cristian Greco",
|
|
4
|
-
"version": "9.12.0",
|
|
5
|
-
"main": "dist/src/index",
|
|
6
|
-
"types": "dist/src/index",
|
|
7
6
|
"keywords": [
|
|
7
|
+
"testing",
|
|
8
8
|
"docker",
|
|
9
9
|
"testcontainers"
|
|
10
10
|
],
|
|
11
|
-
"files": [
|
|
12
|
-
"dist"
|
|
13
|
-
],
|
|
14
11
|
"description": "Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.",
|
|
15
|
-
"license": "MIT",
|
|
16
12
|
"homepage": "https://github.com/testcontainers/testcontainers-node#readme",
|
|
17
13
|
"repository": {
|
|
18
14
|
"type": "git",
|
|
@@ -21,84 +17,43 @@
|
|
|
21
17
|
"bugs": {
|
|
22
18
|
"url": "https://github.com/testcontainers/testcontainers-node/issues"
|
|
23
19
|
},
|
|
20
|
+
"main": "build/index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"build"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
24
27
|
"scripts": {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"build": "npm run clean && tsc -p tsconfig.prod.json",
|
|
28
|
-
"docs:serve": "docker-compose up",
|
|
29
|
-
"clean": "rimraf dist",
|
|
30
|
-
"test": "cross-env DEBUG=testcontainers* jest",
|
|
31
|
-
"test:ci": "npm run test -- --runInBand --coverage",
|
|
32
|
-
"format": "prettier --write package.json \"src/**/*.ts\"",
|
|
33
|
-
"lint": "eslint --fix package.json \"src/**/*.ts\"",
|
|
34
|
-
"lint:ci": "eslint package.json \"src/**/*.ts\" --max-warnings=0",
|
|
35
|
-
"updateDeps": "npx npm-check-updates -u",
|
|
36
|
-
"validateEngine": "npx ls-engines"
|
|
28
|
+
"prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
|
|
29
|
+
"build": "tsc --project tsconfig.build.json"
|
|
37
30
|
},
|
|
38
31
|
"dependencies": {
|
|
39
32
|
"@balena/dockerignore": "^1.0.2",
|
|
40
|
-
"@types/archiver": "^5.3.2",
|
|
41
|
-
"@types/dockerode": "^3.3.19",
|
|
42
33
|
"archiver": "^5.3.1",
|
|
43
34
|
"async-lock": "^1.4.0",
|
|
44
35
|
"byline": "^5.0.0",
|
|
45
36
|
"debug": "^4.3.4",
|
|
46
|
-
"docker-compose": "^0.24.
|
|
37
|
+
"docker-compose": "^0.24.2",
|
|
47
38
|
"dockerode": "^3.3.5",
|
|
48
39
|
"get-port": "^5.1.1",
|
|
49
40
|
"node-fetch": "^2.6.12",
|
|
50
41
|
"proper-lockfile": "^4.1.2",
|
|
51
42
|
"properties-reader": "^2.2.0",
|
|
52
43
|
"ssh-remote-port-forward": "^1.0.4",
|
|
53
|
-
"tar-fs": "^
|
|
44
|
+
"tar-fs": "^3.0.4",
|
|
54
45
|
"tmp": "^0.2.1"
|
|
55
46
|
},
|
|
56
47
|
"devDependencies": {
|
|
57
|
-
"@
|
|
48
|
+
"@types/archiver": "^5.3.2",
|
|
58
49
|
"@types/async-lock": "^1.4.0",
|
|
59
50
|
"@types/byline": "^4.2.33",
|
|
60
|
-
"@types/debug": "4.1.8",
|
|
61
|
-
"@types/
|
|
62
|
-
"@types/node": "^18.16.19",
|
|
51
|
+
"@types/debug": "^4.1.8",
|
|
52
|
+
"@types/dockerode": "^3.3.19",
|
|
63
53
|
"@types/node-fetch": "^2.6.4",
|
|
64
|
-
"@types/pg": "^8.10.2",
|
|
65
54
|
"@types/proper-lockfile": "^4.1.2",
|
|
66
55
|
"@types/properties-reader": "^2.1.1",
|
|
67
|
-
"@types/selenium-webdriver": "^4.1.15",
|
|
68
56
|
"@types/tar-fs": "^2.0.1",
|
|
69
|
-
"@types/tmp": "^0.2.3"
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
71
|
-
"@typescript-eslint/parser": "^5.62.0",
|
|
72
|
-
"arangojs": "^8.4.0",
|
|
73
|
-
"cross-env": "^7.0.3",
|
|
74
|
-
"eslint": "^8.44.0",
|
|
75
|
-
"eslint-config-prettier": "^8.8.0",
|
|
76
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
77
|
-
"husky": "^8.0.3",
|
|
78
|
-
"jest": "^29.6.1",
|
|
79
|
-
"kafkajs": "^2.2.4",
|
|
80
|
-
"lint-staged": "^13.2.3",
|
|
81
|
-
"mongoose": "^6.11.3",
|
|
82
|
-
"mqtt": "^4.3.7",
|
|
83
|
-
"mysql2": "^2.3.3",
|
|
84
|
-
"nats": "^2.15.1",
|
|
85
|
-
"neo4j-driver": "^5.10.0",
|
|
86
|
-
"pg": "^8.11.1",
|
|
87
|
-
"prettier": "^2.8.8",
|
|
88
|
-
"rimraf": "^3.0.2",
|
|
89
|
-
"selenium-webdriver": "^4.10.0",
|
|
90
|
-
"ts-jest": "^29.1.1",
|
|
91
|
-
"ts-node": "^10.9.1",
|
|
92
|
-
"typescript": "^4.9.5",
|
|
93
|
-
"wait-for-expect": "^3.0.2"
|
|
94
|
-
},
|
|
95
|
-
"lint-staged": {
|
|
96
|
-
"src/**/*.ts": [
|
|
97
|
-
"prettier --write",
|
|
98
|
-
"eslint --fix"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
"engines": {
|
|
102
|
-
"node": ">= 10.16"
|
|
57
|
+
"@types/tmp": "^0.2.3"
|
|
103
58
|
}
|
|
104
59
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 - 2023 Cristian Greco
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Testcontainers
|
|
2
|
-
|
|
3
|
-
[](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=116414510&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=EastUs)
|
|
4
|
-
|
|
5
|
-
[](https://github.com/testcontainers/testcontainers-node/actions/workflows/test-main.yml)
|
|
6
|
-
[](https://sonarcloud.io/summary/new_code?id=testcontainers_testcontainers-node)
|
|
7
|
-
[](https://sonarcloud.io/summary/new_code?id=testcontainers_testcontainers-node)
|
|
8
|
-
[](https://www.npmjs.com/package/testcontainers)
|
|
9
|
-
[](https://www.npmjs.com/package/testcontainers)
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
## [📖 Documentation](https://node.testcontainers.org/)
|
|
14
|
-
|
|
15
|
-
## License
|
|
16
|
-
|
|
17
|
-
See [LICENSE](https://github.com/testcontainers/testcontainers-node/blob/main/LICENSE).
|
|
18
|
-
|
|
19
|
-
## Copyright
|
|
20
|
-
|
|
21
|
-
Copyright (c) 2018 - 2023 Cristian Greco and other authors.
|
|
22
|
-
|
|
23
|
-
See [contributors](https://github.com/testcontainers/testcontainers-node/graphs/contributors/) for all contributors.
|
|
24
|
-
|
|
25
|
-
----
|
|
26
|
-
|
|
27
|
-
Join our [Slack workspace](https://slack.testcontainers.org/) | [Testcontainers OSS](https://java.testcontainers.org/) | [Testcontainers Cloud](https://www.testcontainers.cloud/)
|
package/dist/package.json
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "testcontainers",
|
|
3
|
-
"author": "Cristian Greco",
|
|
4
|
-
"version": "9.12.0",
|
|
5
|
-
"main": "dist/src/index",
|
|
6
|
-
"types": "dist/src/index",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"docker",
|
|
9
|
-
"testcontainers"
|
|
10
|
-
],
|
|
11
|
-
"files": [
|
|
12
|
-
"dist"
|
|
13
|
-
],
|
|
14
|
-
"description": "Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.",
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"homepage": "https://github.com/testcontainers/testcontainers-node#readme",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/testcontainers/testcontainers-node"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/testcontainers/testcontainers-node/issues"
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"prepare": "npm run build && husky install",
|
|
26
|
-
"pre-commit": "lint-staged",
|
|
27
|
-
"build": "npm run clean && tsc -p tsconfig.prod.json",
|
|
28
|
-
"docs:serve": "docker-compose up",
|
|
29
|
-
"clean": "rimraf dist",
|
|
30
|
-
"test": "cross-env DEBUG=testcontainers* jest",
|
|
31
|
-
"test:ci": "npm run test -- --runInBand --coverage",
|
|
32
|
-
"format": "prettier --write package.json \"src/**/*.ts\"",
|
|
33
|
-
"lint": "eslint --fix package.json \"src/**/*.ts\"",
|
|
34
|
-
"lint:ci": "eslint package.json \"src/**/*.ts\" --max-warnings=0",
|
|
35
|
-
"updateDeps": "npx npm-check-updates -u",
|
|
36
|
-
"validateEngine": "npx ls-engines"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@balena/dockerignore": "^1.0.2",
|
|
40
|
-
"@types/archiver": "^5.3.2",
|
|
41
|
-
"@types/dockerode": "^3.3.19",
|
|
42
|
-
"archiver": "^5.3.1",
|
|
43
|
-
"async-lock": "^1.4.0",
|
|
44
|
-
"byline": "^5.0.0",
|
|
45
|
-
"debug": "^4.3.4",
|
|
46
|
-
"docker-compose": "^0.24.1",
|
|
47
|
-
"dockerode": "^3.3.5",
|
|
48
|
-
"get-port": "^5.1.1",
|
|
49
|
-
"node-fetch": "^2.6.12",
|
|
50
|
-
"proper-lockfile": "^4.1.2",
|
|
51
|
-
"properties-reader": "^2.2.0",
|
|
52
|
-
"ssh-remote-port-forward": "^1.0.4",
|
|
53
|
-
"tar-fs": "^2.1.1",
|
|
54
|
-
"tmp": "^0.2.1"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@elastic/elasticsearch": "^7.17.11",
|
|
58
|
-
"@types/async-lock": "^1.4.0",
|
|
59
|
-
"@types/byline": "^4.2.33",
|
|
60
|
-
"@types/debug": "4.1.8",
|
|
61
|
-
"@types/jest": "^29.5.3",
|
|
62
|
-
"@types/node": "^18.16.19",
|
|
63
|
-
"@types/node-fetch": "^2.6.4",
|
|
64
|
-
"@types/pg": "^8.10.2",
|
|
65
|
-
"@types/proper-lockfile": "^4.1.2",
|
|
66
|
-
"@types/properties-reader": "^2.1.1",
|
|
67
|
-
"@types/selenium-webdriver": "^4.1.15",
|
|
68
|
-
"@types/tar-fs": "^2.0.1",
|
|
69
|
-
"@types/tmp": "^0.2.3",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
71
|
-
"@typescript-eslint/parser": "^5.62.0",
|
|
72
|
-
"arangojs": "^8.4.0",
|
|
73
|
-
"cross-env": "^7.0.3",
|
|
74
|
-
"eslint": "^8.44.0",
|
|
75
|
-
"eslint-config-prettier": "^8.8.0",
|
|
76
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
77
|
-
"husky": "^8.0.3",
|
|
78
|
-
"jest": "^29.6.1",
|
|
79
|
-
"kafkajs": "^2.2.4",
|
|
80
|
-
"lint-staged": "^13.2.3",
|
|
81
|
-
"mongoose": "^6.11.3",
|
|
82
|
-
"mqtt": "^4.3.7",
|
|
83
|
-
"mysql2": "^2.3.3",
|
|
84
|
-
"nats": "^2.15.1",
|
|
85
|
-
"neo4j-driver": "^5.10.0",
|
|
86
|
-
"pg": "^8.11.1",
|
|
87
|
-
"prettier": "^2.8.8",
|
|
88
|
-
"rimraf": "^3.0.2",
|
|
89
|
-
"selenium-webdriver": "^4.10.0",
|
|
90
|
-
"ts-jest": "^29.1.1",
|
|
91
|
-
"ts-node": "^10.9.1",
|
|
92
|
-
"typescript": "^4.9.5",
|
|
93
|
-
"wait-for-expect": "^3.0.2"
|
|
94
|
-
},
|
|
95
|
-
"lint-staged": {
|
|
96
|
-
"src/**/*.ts": [
|
|
97
|
-
"prettier --write",
|
|
98
|
-
"eslint --fix"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
"engines": {
|
|
102
|
-
"node": ">= 10.16"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export type DockerClientConfig = {
|
|
3
|
-
tcHost?: string;
|
|
4
|
-
dockerHost?: string;
|
|
5
|
-
dockerTlsVerify?: string;
|
|
6
|
-
dockerCertPath?: string;
|
|
7
|
-
};
|
|
8
|
-
export type GetDockerClientConfig = (env?: NodeJS.ProcessEnv) => Promise<DockerClientConfig>;
|
|
9
|
-
export declare const getDockerClientConfig: GetDockerClientConfig;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getDockerClientConfig = void 0;
|
|
16
|
-
const path_1 = __importDefault(require("path"));
|
|
17
|
-
const logger_1 = require("../../logger");
|
|
18
|
-
const os_1 = require("os");
|
|
19
|
-
const fs_1 = require("fs");
|
|
20
|
-
const promises_1 = require("fs/promises");
|
|
21
|
-
const properties_reader_1 = __importDefault(require("properties-reader"));
|
|
22
|
-
let dockerClientConfig;
|
|
23
|
-
const getDockerClientConfig = (env = process.env) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
if (!dockerClientConfig) {
|
|
25
|
-
dockerClientConfig = Object.assign(Object.assign({}, (yield loadFromFile())), loadFromEnv(env));
|
|
26
|
-
logDockerClientConfig(dockerClientConfig);
|
|
27
|
-
}
|
|
28
|
-
return dockerClientConfig;
|
|
29
|
-
});
|
|
30
|
-
exports.getDockerClientConfig = getDockerClientConfig;
|
|
31
|
-
function loadFromFile() {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const file = path_1.default.resolve((0, os_1.homedir)(), ".testcontainers.properties");
|
|
34
|
-
const dockerClientConfig = {};
|
|
35
|
-
if ((0, fs_1.existsSync)(file)) {
|
|
36
|
-
logger_1.log.debug(`Loading ".testcontainers.properties" file...`);
|
|
37
|
-
const string = yield (0, promises_1.readFile)(file, { encoding: "utf-8" });
|
|
38
|
-
const properties = (0, properties_reader_1.default)("").read(string);
|
|
39
|
-
const tcHost = properties.get("tc.host");
|
|
40
|
-
if (tcHost !== null) {
|
|
41
|
-
dockerClientConfig.tcHost = tcHost;
|
|
42
|
-
}
|
|
43
|
-
const dockerHost = properties.get("docker.host");
|
|
44
|
-
if (dockerHost !== null) {
|
|
45
|
-
dockerClientConfig.dockerHost = dockerHost;
|
|
46
|
-
}
|
|
47
|
-
const dockerTlsVerify = properties.get("docker.tls.verify");
|
|
48
|
-
if (dockerTlsVerify !== null) {
|
|
49
|
-
dockerClientConfig.dockerTlsVerify = `${dockerTlsVerify}`;
|
|
50
|
-
}
|
|
51
|
-
const dockerCertPath = properties.get("docker.cert.path");
|
|
52
|
-
if (dockerCertPath !== null) {
|
|
53
|
-
dockerClientConfig.dockerCertPath = dockerCertPath;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return dockerClientConfig;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function loadFromEnv(env) {
|
|
60
|
-
const dockerClientConfig = {};
|
|
61
|
-
if (env["DOCKER_HOST"] !== undefined) {
|
|
62
|
-
dockerClientConfig.dockerHost = env["DOCKER_HOST"];
|
|
63
|
-
}
|
|
64
|
-
if (env["DOCKER_TLS_VERIFY"] !== undefined) {
|
|
65
|
-
dockerClientConfig.dockerTlsVerify = env["DOCKER_TLS_VERIFY"];
|
|
66
|
-
}
|
|
67
|
-
if (env["DOCKER_CERT_PATH"] !== undefined) {
|
|
68
|
-
dockerClientConfig.dockerCertPath = env["DOCKER_CERT_PATH"];
|
|
69
|
-
}
|
|
70
|
-
return dockerClientConfig;
|
|
71
|
-
}
|
|
72
|
-
function logDockerClientConfig(config) {
|
|
73
|
-
if (!logger_1.log.enabled()) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const configurations = Object.entries(config)
|
|
77
|
-
.filter(([, value]) => value !== undefined)
|
|
78
|
-
.map(([key, value]) => `${key}: "${value}"`);
|
|
79
|
-
if (configurations.length > 0) {
|
|
80
|
-
logger_1.log.debug(`Loaded Docker client configuration, ${configurations.join(", ")}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import Dockerode, { DockerOptions } from "dockerode";
|
|
3
|
-
import { HostIps } from "../lookup-host-ips";
|
|
4
|
-
import { SystemInfo } from "../../system-info";
|
|
5
|
-
import { ContainerRuntime } from "../types";
|
|
6
|
-
import { DockerComposeClient } from "../../docker-compose/docker-compose-client";
|
|
7
|
-
export type DockerClient = PartialDockerClient & {
|
|
8
|
-
sessionId: string;
|
|
9
|
-
};
|
|
10
|
-
export type PartialDockerClient = DockerClientStrategyResult & {
|
|
11
|
-
dockerode: Dockerode;
|
|
12
|
-
dockerComposeClient: DockerComposeClient;
|
|
13
|
-
host: string;
|
|
14
|
-
containerRuntime: ContainerRuntime;
|
|
15
|
-
hostIps: HostIps;
|
|
16
|
-
info: SystemInfo;
|
|
17
|
-
};
|
|
18
|
-
export type DockerClientStrategyResult = {
|
|
19
|
-
uri: string;
|
|
20
|
-
dockerOptions: DockerOptions;
|
|
21
|
-
composeEnvironment: NodeJS.ProcessEnv;
|
|
22
|
-
allowUserOverrides: boolean;
|
|
23
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getDockerClient = void 0;
|
|
16
|
-
const dockerode_1 = __importDefault(require("dockerode"));
|
|
17
|
-
const logger_1 = require("../../logger");
|
|
18
|
-
const lookup_host_ips_1 = require("../lookup-host-ips");
|
|
19
|
-
const system_info_1 = require("../../system-info");
|
|
20
|
-
const rootless_unix_socket_strategy_1 = require("./strategy/rootless-unix-socket-strategy");
|
|
21
|
-
const stream_utils_1 = require("../../stream-utils");
|
|
22
|
-
const stream_1 = require("stream");
|
|
23
|
-
const resolve_host_1 = require("../resolve-host");
|
|
24
|
-
const configuration_strategy_1 = require("./strategy/configuration-strategy");
|
|
25
|
-
const unix_socket_strategy_1 = require("./strategy/unix-socket-strategy");
|
|
26
|
-
const npipe_socket_strategy_1 = require("./strategy/npipe-socket-strategy");
|
|
27
|
-
const testcontainers_host_strategy_1 = require("./strategy/testcontainers-host-strategy");
|
|
28
|
-
const uuid_1 = require("../../uuid");
|
|
29
|
-
const file_lock_1 = require("../../file-lock");
|
|
30
|
-
const reaper_1 = require("../../reaper");
|
|
31
|
-
const docker_compose_client_1 = require("../../docker-compose/docker-compose-client");
|
|
32
|
-
let dockerClient;
|
|
33
|
-
const strategies = [
|
|
34
|
-
new testcontainers_host_strategy_1.TestcontainersHostStrategy(),
|
|
35
|
-
new configuration_strategy_1.ConfigurationStrategy(),
|
|
36
|
-
new unix_socket_strategy_1.UnixSocketStrategy(),
|
|
37
|
-
new rootless_unix_socket_strategy_1.RootlessUnixSocketStrategy(),
|
|
38
|
-
new npipe_socket_strategy_1.NpipeSocketStrategy(),
|
|
39
|
-
];
|
|
40
|
-
function getDockerClient() {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
if (dockerClient) {
|
|
43
|
-
return dockerClient;
|
|
44
|
-
}
|
|
45
|
-
for (const strategy of strategies) {
|
|
46
|
-
try {
|
|
47
|
-
const initialisedDockerClient = yield initialiseStrategy(strategy);
|
|
48
|
-
if (!initialisedDockerClient) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
dockerClient = initialisedDockerClient;
|
|
52
|
-
logDockerClient(strategy.getName(), dockerClient);
|
|
53
|
-
return dockerClient;
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
logger_1.log.warn(`Docker client strategy "${strategy.getName()}" threw: "${err}"`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
throw new Error("No Docker client strategy found");
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
exports.getDockerClient = getDockerClient;
|
|
63
|
-
function initialiseStrategy(strategy) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
const partialDockerClient = yield tryToCreateDockerClient(strategy);
|
|
66
|
-
if (!partialDockerClient) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
yield (0, file_lock_1.withFileLock)("tc.lock", () => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
var _a;
|
|
71
|
-
const dockerode = new dockerode_1.default(partialDockerClient.dockerOptions);
|
|
72
|
-
const containers = yield dockerode.listContainers();
|
|
73
|
-
const reaperContainer = containers.find((container) => container.Labels["org.testcontainers.ryuk"] === "true");
|
|
74
|
-
const sessionId = (_a = reaperContainer === null || reaperContainer === void 0 ? void 0 : reaperContainer.Labels["org.testcontainers.session-id"]) !== null && _a !== void 0 ? _a : new uuid_1.RandomUuid().nextUuid();
|
|
75
|
-
const dockerOptions = Object.assign(Object.assign({}, partialDockerClient.dockerOptions), { headers: Object.assign(Object.assign({}, partialDockerClient.dockerOptions.headers), { "x-tc-sid": sessionId }) });
|
|
76
|
-
dockerClient = Object.assign(Object.assign({}, partialDockerClient), { sessionId,
|
|
77
|
-
dockerOptions, dockerode: new dockerode_1.default(dockerOptions) });
|
|
78
|
-
yield (0, reaper_1.startReaper)(dockerClient, sessionId, reaperContainer);
|
|
79
|
-
yield (0, reaper_1.registerSessionIdForCleanup)(sessionId);
|
|
80
|
-
}));
|
|
81
|
-
return dockerClient;
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
function tryToCreateDockerClient(strategy) {
|
|
85
|
-
var _a;
|
|
86
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
if (strategy.init) {
|
|
88
|
-
yield strategy.init();
|
|
89
|
-
}
|
|
90
|
-
if (strategy.isApplicable()) {
|
|
91
|
-
const dockerClientStrategyResult = yield strategy.getDockerClient();
|
|
92
|
-
logger_1.log.debug(`Testing Docker client strategy "${strategy.getName()}" with URI "${dockerClientStrategyResult.uri}"...`);
|
|
93
|
-
const dockerode = new dockerode_1.default(dockerClientStrategyResult.dockerOptions);
|
|
94
|
-
if (yield isDockerDaemonReachable(dockerode)) {
|
|
95
|
-
const info = yield (0, system_info_1.getSystemInfo)(dockerode);
|
|
96
|
-
const containerRuntime = dockerClientStrategyResult.uri.includes("podman.sock")
|
|
97
|
-
? "podman"
|
|
98
|
-
: "docker";
|
|
99
|
-
const host = yield (0, resolve_host_1.resolveHost)(dockerode, containerRuntime, info.dockerInfo.indexServerAddress, dockerClientStrategyResult.uri, dockerClientStrategyResult.allowUserOverrides);
|
|
100
|
-
const hostIps = yield (0, lookup_host_ips_1.lookupHostIps)(host);
|
|
101
|
-
const dockerComposeClient = yield (0, docker_compose_client_1.getDockerComposeClient)((_a = info.dockerComposeInfo) === null || _a === void 0 ? void 0 : _a.compatability);
|
|
102
|
-
return Object.assign(Object.assign({}, dockerClientStrategyResult), { containerRuntime,
|
|
103
|
-
host,
|
|
104
|
-
hostIps,
|
|
105
|
-
info,
|
|
106
|
-
dockerode,
|
|
107
|
-
dockerComposeClient });
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
logger_1.log.warn(`Docker client strategy "${strategy.getName()}" does not work`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function isDockerDaemonReachable(dockerode) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
try {
|
|
118
|
-
const response = yield dockerode.ping();
|
|
119
|
-
return (yield (0, stream_utils_1.streamToString)(stream_1.Readable.from(response))) === "OK";
|
|
120
|
-
}
|
|
121
|
-
catch (err) {
|
|
122
|
-
logger_1.log.warn(`Docker daemon is not reachable: "${err}"`);
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
function logDockerClient(strategyName, { host, hostIps }) {
|
|
128
|
-
if (!logger_1.log.enabled()) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const formattedHostIps = hostIps.map((hostIp) => hostIp.address).join(", ");
|
|
132
|
-
logger_1.log.info(`Docker client strategy "${strategyName}" works, ${host} (${formattedHostIps})`);
|
|
133
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DockerClientStrategyResult } from "../docker-client-types";
|
|
2
|
-
import { DockerClientStrategy } from "./docker-client-strategy";
|
|
3
|
-
export declare class ConfigurationStrategy implements DockerClientStrategy {
|
|
4
|
-
private dockerHost;
|
|
5
|
-
private dockerTlsVerify;
|
|
6
|
-
private dockerCertPath;
|
|
7
|
-
init(): Promise<void>;
|
|
8
|
-
getDockerClient(): Promise<DockerClientStrategyResult>;
|
|
9
|
-
isApplicable(): boolean;
|
|
10
|
-
getName(): string;
|
|
11
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ConfigurationStrategy = void 0;
|
|
16
|
-
const docker_client_config_1 = require("../docker-client-config");
|
|
17
|
-
const url_1 = require("url");
|
|
18
|
-
const fs_1 = require("fs");
|
|
19
|
-
const path_1 = __importDefault(require("path"));
|
|
20
|
-
class ConfigurationStrategy {
|
|
21
|
-
init() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const { dockerHost, dockerTlsVerify, dockerCertPath } = yield (0, docker_client_config_1.getDockerClientConfig)();
|
|
24
|
-
if (dockerHost) {
|
|
25
|
-
this.dockerHost = dockerHost;
|
|
26
|
-
}
|
|
27
|
-
this.dockerTlsVerify = dockerTlsVerify;
|
|
28
|
-
this.dockerCertPath = dockerCertPath;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
getDockerClient() {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const dockerOptions = {};
|
|
34
|
-
const { pathname, hostname, port } = new url_1.URL(this.dockerHost);
|
|
35
|
-
if (hostname !== "") {
|
|
36
|
-
dockerOptions.host = hostname;
|
|
37
|
-
dockerOptions.port = port;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
dockerOptions.socketPath = pathname;
|
|
41
|
-
}
|
|
42
|
-
if (this.dockerTlsVerify === "1" && this.dockerCertPath !== undefined) {
|
|
43
|
-
dockerOptions.ca = yield fs_1.promises.readFile(path_1.default.resolve(this.dockerCertPath, "ca.pem"));
|
|
44
|
-
dockerOptions.cert = yield fs_1.promises.readFile(path_1.default.resolve(this.dockerCertPath, "cert.pem"));
|
|
45
|
-
dockerOptions.key = yield fs_1.promises.readFile(path_1.default.resolve(this.dockerCertPath, "key.pem"));
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
uri: this.dockerHost,
|
|
49
|
-
dockerOptions,
|
|
50
|
-
composeEnvironment: {
|
|
51
|
-
DOCKER_HOST: this.dockerHost,
|
|
52
|
-
DOCKER_TLS_VERIFY: this.dockerTlsVerify,
|
|
53
|
-
DOCKER_CERT_PATH: this.dockerCertPath,
|
|
54
|
-
},
|
|
55
|
-
allowUserOverrides: true,
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
isApplicable() {
|
|
60
|
-
return this.dockerHost !== undefined;
|
|
61
|
-
}
|
|
62
|
-
getName() {
|
|
63
|
-
return "ConfigurationStrategy";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.ConfigurationStrategy = ConfigurationStrategy;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DockerClientStrategyResult } from "../docker-client-types";
|
|
2
|
-
import { DockerClientStrategy } from "./docker-client-strategy";
|
|
3
|
-
export declare class NpipeSocketStrategy implements DockerClientStrategy {
|
|
4
|
-
getDockerClient(): Promise<DockerClientStrategyResult>;
|
|
5
|
-
isApplicable(): boolean;
|
|
6
|
-
getName(): string;
|
|
7
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.NpipeSocketStrategy = void 0;
|
|
13
|
-
class NpipeSocketStrategy {
|
|
14
|
-
getDockerClient() {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
return {
|
|
17
|
-
uri: "npipe:////./pipe/docker_engine",
|
|
18
|
-
dockerOptions: { socketPath: "//./pipe/docker_engine" },
|
|
19
|
-
composeEnvironment: {},
|
|
20
|
-
allowUserOverrides: true,
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
isApplicable() {
|
|
25
|
-
return process.platform === "win32";
|
|
26
|
-
}
|
|
27
|
-
getName() {
|
|
28
|
-
return "NpipeSocketStrategy";
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.NpipeSocketStrategy = NpipeSocketStrategy;
|