testcontainers 9.12.0 → 10.0.0-beta.6
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 +20 -65
- 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
|
@@ -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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { DockerClientStrategyResult } from "../docker-client-types";
|
|
3
|
-
import { DockerClientStrategy } from "./docker-client-strategy";
|
|
4
|
-
export declare class RootlessUnixSocketStrategy implements DockerClientStrategy {
|
|
5
|
-
private readonly platform;
|
|
6
|
-
private readonly env;
|
|
7
|
-
private applicable;
|
|
8
|
-
private socketPath;
|
|
9
|
-
constructor(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv);
|
|
10
|
-
init(): Promise<void>;
|
|
11
|
-
private getSocketPathFromEnv;
|
|
12
|
-
private getSocketPathFromHomeRunDir;
|
|
13
|
-
private getSocketPathFromHomeDesktopDir;
|
|
14
|
-
private getSocketPathFromRunDir;
|
|
15
|
-
getDockerClient(): Promise<DockerClientStrategyResult>;
|
|
16
|
-
isApplicable(): boolean;
|
|
17
|
-
getName(): string;
|
|
18
|
-
}
|
|
@@ -1,77 +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.RootlessUnixSocketStrategy = void 0;
|
|
16
|
-
const type_guards_1 = require("../../../type-guards");
|
|
17
|
-
const fs_1 = require("fs");
|
|
18
|
-
const path_1 = __importDefault(require("path"));
|
|
19
|
-
const os_1 = __importDefault(require("os"));
|
|
20
|
-
class RootlessUnixSocketStrategy {
|
|
21
|
-
constructor(platform = process.platform, env = process.env) {
|
|
22
|
-
this.platform = platform;
|
|
23
|
-
this.env = env;
|
|
24
|
-
}
|
|
25
|
-
init() {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
if (this.platform !== "linux" && this.platform !== "darwin") {
|
|
28
|
-
this.applicable = false;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
this.socketPath = [
|
|
32
|
-
this.getSocketPathFromEnv(),
|
|
33
|
-
this.getSocketPathFromHomeRunDir(),
|
|
34
|
-
this.getSocketPathFromHomeDesktopDir(),
|
|
35
|
-
this.getSocketPathFromRunDir(),
|
|
36
|
-
]
|
|
37
|
-
.filter(type_guards_1.isDefined)
|
|
38
|
-
.find((candidateSocketPath) => (0, fs_1.existsSync)(candidateSocketPath));
|
|
39
|
-
this.applicable = this.socketPath !== undefined;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
getSocketPathFromEnv() {
|
|
43
|
-
const xdgRuntimeDir = this.env["XDG_RUNTIME_DIR"];
|
|
44
|
-
if (xdgRuntimeDir !== undefined) {
|
|
45
|
-
return path_1.default.join(xdgRuntimeDir, "docker.sock");
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
getSocketPathFromHomeRunDir() {
|
|
52
|
-
return path_1.default.join(os_1.default.homedir(), ".docker", "run", "docker.sock");
|
|
53
|
-
}
|
|
54
|
-
getSocketPathFromHomeDesktopDir() {
|
|
55
|
-
return path_1.default.join(os_1.default.homedir(), ".docker", "desktop", "docker.sock");
|
|
56
|
-
}
|
|
57
|
-
getSocketPathFromRunDir() {
|
|
58
|
-
return path_1.default.join("/run", "user", `${os_1.default.userInfo().uid}`, "docker.sock");
|
|
59
|
-
}
|
|
60
|
-
getDockerClient() {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return {
|
|
63
|
-
uri: `unix://${this.socketPath}`,
|
|
64
|
-
dockerOptions: { socketPath: this.socketPath },
|
|
65
|
-
composeEnvironment: {},
|
|
66
|
-
allowUserOverrides: true,
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
isApplicable() {
|
|
71
|
-
return this.applicable;
|
|
72
|
-
}
|
|
73
|
-
getName() {
|
|
74
|
-
return "RootlessUnixSocketStrategy";
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.RootlessUnixSocketStrategy = RootlessUnixSocketStrategy;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DockerClientStrategyResult } from "../docker-client-types";
|
|
2
|
-
import { DockerClientStrategy } from "./docker-client-strategy";
|
|
3
|
-
export declare class TestcontainersHostStrategy implements DockerClientStrategy {
|
|
4
|
-
private host;
|
|
5
|
-
init(): Promise<void>;
|
|
6
|
-
getDockerClient(): Promise<DockerClientStrategyResult>;
|
|
7
|
-
isApplicable(): boolean;
|
|
8
|
-
getName(): string;
|
|
9
|
-
}
|
|
@@ -1,47 +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.TestcontainersHostStrategy = void 0;
|
|
13
|
-
const docker_client_config_1 = require("../docker-client-config");
|
|
14
|
-
const url_1 = require("url");
|
|
15
|
-
class TestcontainersHostStrategy {
|
|
16
|
-
init() {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const { tcHost } = yield (0, docker_client_config_1.getDockerClientConfig)();
|
|
19
|
-
if (tcHost) {
|
|
20
|
-
this.host = tcHost;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
getDockerClient() {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const dockerOptions = {};
|
|
27
|
-
const { hostname, port } = new url_1.URL(this.host);
|
|
28
|
-
dockerOptions.host = hostname;
|
|
29
|
-
dockerOptions.port = port;
|
|
30
|
-
return {
|
|
31
|
-
uri: this.host,
|
|
32
|
-
dockerOptions,
|
|
33
|
-
composeEnvironment: {
|
|
34
|
-
DOCKER_HOST: this.host,
|
|
35
|
-
},
|
|
36
|
-
allowUserOverrides: false,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
isApplicable() {
|
|
41
|
-
return this.host !== undefined;
|
|
42
|
-
}
|
|
43
|
-
getName() {
|
|
44
|
-
return "TestcontainersHostStrategy";
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.TestcontainersHostStrategy = TestcontainersHostStrategy;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DockerClientStrategyResult } from "../docker-client-types";
|
|
2
|
-
import { DockerClientStrategy } from "./docker-client-strategy";
|
|
3
|
-
export declare class UnixSocketStrategy implements DockerClientStrategy {
|
|
4
|
-
getDockerClient(): Promise<DockerClientStrategyResult>;
|
|
5
|
-
isApplicable(): boolean;
|
|
6
|
-
getName(): string;
|
|
7
|
-
}
|
|
@@ -1,32 +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.UnixSocketStrategy = void 0;
|
|
13
|
-
const fs_1 = require("fs");
|
|
14
|
-
class UnixSocketStrategy {
|
|
15
|
-
getDockerClient() {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
return {
|
|
18
|
-
uri: "unix:///var/run/docker.sock",
|
|
19
|
-
dockerOptions: { socketPath: "/var/run/docker.sock" },
|
|
20
|
-
composeEnvironment: {},
|
|
21
|
-
allowUserOverrides: true,
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
isApplicable() {
|
|
26
|
-
return (process.platform === "linux" || process.platform === "darwin") && (0, fs_1.existsSync)("/var/run/docker.sock");
|
|
27
|
-
}
|
|
28
|
-
getName() {
|
|
29
|
-
return "UnixSocketStrategy";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.UnixSocketStrategy = UnixSocketStrategy;
|
|
@@ -1,25 +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.attachContainer = void 0;
|
|
13
|
-
const demux_stream_1 = require("../demux-stream");
|
|
14
|
-
const logger_1 = require("../../../logger");
|
|
15
|
-
const attachContainer = (dockerode, container) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
try {
|
|
17
|
-
const stream = (yield container.attach({ stream: true, stdout: true, stderr: true }));
|
|
18
|
-
return (0, demux_stream_1.demuxStream)(dockerode, stream);
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
logger_1.log.error(`Failed to attach to container: ${err}`, { containerId: container.id });
|
|
22
|
-
throw err;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
exports.attachContainer = attachContainer;
|
|
@@ -1,32 +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.containerLogs = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const demux_stream_1 = require("../demux-stream");
|
|
15
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
16
|
-
const containerLogs = (container, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
try {
|
|
18
|
-
const stream = (yield container.logs({
|
|
19
|
-
follow: true,
|
|
20
|
-
stdout: true,
|
|
21
|
-
stderr: true,
|
|
22
|
-
since: options.since ? options.since.getTime() / 1000 : 0,
|
|
23
|
-
}));
|
|
24
|
-
stream.socket.unref();
|
|
25
|
-
return (0, demux_stream_1.demuxStream)((yield (0, docker_client_1.getDockerClient)()).dockerode, stream);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
logger_1.log.error(`Failed to get container logs: ${err}`);
|
|
29
|
-
throw err;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
exports.containerLogs = containerLogs;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { DockerImageName } from "../../../docker-image-name";
|
|
2
|
-
import Dockerode from "dockerode";
|
|
3
|
-
import { PortWithOptionalBinding } from "../../../port";
|
|
4
|
-
import { BindMount, Environment, ExtraHost, HealthCheck, Labels, ResourcesQuota, TmpFs, Ulimits } from "../../types";
|
|
5
|
-
export type CreateContainerOptions = {
|
|
6
|
-
imageName: DockerImageName;
|
|
7
|
-
environment: Environment;
|
|
8
|
-
command: string[];
|
|
9
|
-
entrypoint?: string[];
|
|
10
|
-
bindMounts: BindMount[];
|
|
11
|
-
tmpFs: TmpFs;
|
|
12
|
-
exposedPorts: PortWithOptionalBinding[];
|
|
13
|
-
name?: string;
|
|
14
|
-
reusable: boolean;
|
|
15
|
-
labels?: Labels;
|
|
16
|
-
networkMode?: string;
|
|
17
|
-
healthCheck?: HealthCheck;
|
|
18
|
-
useDefaultLogDriver: boolean;
|
|
19
|
-
privilegedMode: boolean;
|
|
20
|
-
autoRemove: boolean;
|
|
21
|
-
extraHosts: ExtraHost[];
|
|
22
|
-
ipcMode?: string;
|
|
23
|
-
ulimits?: Ulimits;
|
|
24
|
-
addedCapabilities?: string[];
|
|
25
|
-
droppedCapabilities?: string[];
|
|
26
|
-
user?: string;
|
|
27
|
-
workingDir?: string;
|
|
28
|
-
resourcesQuota?: ResourcesQuota;
|
|
29
|
-
sharedMemorySize?: number;
|
|
30
|
-
};
|
|
31
|
-
export declare const createContainer: (sessionId: string, options: CreateContainerOptions) => Promise<Dockerode.Container>;
|
|
@@ -1,117 +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.createContainer = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
15
|
-
const port_1 = require("../../../port");
|
|
16
|
-
const create_labels_1 = require("../create-labels");
|
|
17
|
-
const createContainer = (sessionId, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
try {
|
|
20
|
-
logger_1.log.info(`Creating container for image "${options.imageName}"...`);
|
|
21
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
22
|
-
const container = yield dockerode.createContainer({
|
|
23
|
-
name: options.name,
|
|
24
|
-
User: options.user,
|
|
25
|
-
Image: options.imageName.toString(),
|
|
26
|
-
Env: getEnvironment(options.environment),
|
|
27
|
-
ExposedPorts: getExposedPorts(options.exposedPorts),
|
|
28
|
-
Cmd: options.command,
|
|
29
|
-
Entrypoint: options.entrypoint,
|
|
30
|
-
Labels: (0, create_labels_1.createLabels)(sessionId, options.reusable, options.labels),
|
|
31
|
-
Healthcheck: getHealthCheck(options.healthCheck),
|
|
32
|
-
WorkingDir: options.workingDir,
|
|
33
|
-
HostConfig: {
|
|
34
|
-
IpcMode: options.ipcMode,
|
|
35
|
-
ExtraHosts: getExtraHosts(options.extraHosts),
|
|
36
|
-
AutoRemove: options.autoRemove,
|
|
37
|
-
NetworkMode: options.networkMode,
|
|
38
|
-
PortBindings: getPortBindings(options.exposedPorts),
|
|
39
|
-
Binds: getBindMounts(options.bindMounts),
|
|
40
|
-
Tmpfs: options.tmpFs,
|
|
41
|
-
LogConfig: getLogConfig(options.useDefaultLogDriver),
|
|
42
|
-
Privileged: options.privilegedMode,
|
|
43
|
-
Ulimits: getUlimits(options.ulimits),
|
|
44
|
-
CapAdd: options.addedCapabilities,
|
|
45
|
-
CapDrop: options.droppedCapabilities,
|
|
46
|
-
Memory: (_a = options.resourcesQuota) === null || _a === void 0 ? void 0 : _a.memory,
|
|
47
|
-
NanoCpus: (_b = options.resourcesQuota) === null || _b === void 0 ? void 0 : _b.cpu,
|
|
48
|
-
ShmSize: options.sharedMemorySize,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
logger_1.log.info(`Created container for image "${options.imageName}"`, { containerId: container.id });
|
|
52
|
-
return container;
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
logger_1.log.error(`Failed to create container for image "${options.imageName}": ${err}`);
|
|
56
|
-
throw err;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
exports.createContainer = createContainer;
|
|
60
|
-
const getEnvironment = (environment) => Object.entries(environment).reduce((dockerodeEnvironment, [key, value]) => [...dockerodeEnvironment, `${key}=${value}`], []);
|
|
61
|
-
const getExposedPorts = (exposedPorts) => {
|
|
62
|
-
const dockerodeExposedPorts = {};
|
|
63
|
-
for (const exposedPort of exposedPorts) {
|
|
64
|
-
dockerodeExposedPorts[(0, port_1.getContainerPort)(exposedPort).toString()] = {};
|
|
65
|
-
}
|
|
66
|
-
return dockerodeExposedPorts;
|
|
67
|
-
};
|
|
68
|
-
const getExtraHosts = (extraHosts) => {
|
|
69
|
-
return extraHosts.map((extraHost) => `${extraHost.host}:${extraHost.ipAddress}`);
|
|
70
|
-
};
|
|
71
|
-
const getPortBindings = (exposedPorts) => {
|
|
72
|
-
const dockerodePortBindings = {};
|
|
73
|
-
for (const exposedPort of exposedPorts) {
|
|
74
|
-
if ((0, port_1.hasHostBinding)(exposedPort)) {
|
|
75
|
-
dockerodePortBindings[exposedPort.container] = [{ HostPort: exposedPort.host.toString() }];
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
dockerodePortBindings[exposedPort] = [{ HostPort: "0" }];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return dockerodePortBindings;
|
|
82
|
-
};
|
|
83
|
-
const getBindMounts = (bindMounts) => {
|
|
84
|
-
return bindMounts.map(({ source, target, mode }) => `${source}:${target}:${mode}`);
|
|
85
|
-
};
|
|
86
|
-
const getHealthCheck = (healthCheck) => {
|
|
87
|
-
if (healthCheck === undefined) {
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
Test: healthCheck.test,
|
|
92
|
-
Interval: healthCheck.interval ? toNanos(healthCheck.interval) : 0,
|
|
93
|
-
Timeout: healthCheck.timeout ? toNanos(healthCheck.timeout) : 0,
|
|
94
|
-
Retries: healthCheck.retries || 0,
|
|
95
|
-
StartPeriod: healthCheck.startPeriod ? toNanos(healthCheck.startPeriod) : 0,
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
const toNanos = (duration) => duration * 1e6;
|
|
99
|
-
const getLogConfig = (useDefaultLogDriver) => {
|
|
100
|
-
if (!useDefaultLogDriver) {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
Type: "json-file",
|
|
105
|
-
Config: {},
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
const getUlimits = (ulimits) => {
|
|
109
|
-
if (!ulimits) {
|
|
110
|
-
return undefined;
|
|
111
|
-
}
|
|
112
|
-
return Object.entries(ulimits).map(([key, value]) => ({
|
|
113
|
-
Name: key,
|
|
114
|
-
Hard: value.hard,
|
|
115
|
-
Soft: value.soft,
|
|
116
|
-
}));
|
|
117
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ContainerRuntime, ExecResult } from "../../types";
|
|
2
|
-
import Dockerode from "dockerode";
|
|
3
|
-
export declare const execContainer: (dockerode: Dockerode, containerRuntime: ContainerRuntime, container: Dockerode.Container, command: string[], shouldLog?: boolean) => Promise<ExecResult>;
|
|
@@ -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.execContainer = void 0;
|
|
16
|
-
const logger_1 = require("../../../logger");
|
|
17
|
-
const byline_1 = __importDefault(require("byline"));
|
|
18
|
-
const demux_stream_1 = require("../demux-stream");
|
|
19
|
-
const execContainer = (dockerode, containerRuntime, container, command, shouldLog = true) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const chunks = [];
|
|
21
|
-
try {
|
|
22
|
-
const exec = yield container.exec({
|
|
23
|
-
Cmd: command,
|
|
24
|
-
AttachStdout: true,
|
|
25
|
-
AttachStderr: true,
|
|
26
|
-
});
|
|
27
|
-
const stream = yield startExec(dockerode, containerRuntime, exec, container);
|
|
28
|
-
stream.on("data", (chunk) => chunks.push(chunk));
|
|
29
|
-
if (shouldLog && logger_1.execLog.enabled()) {
|
|
30
|
-
(0, byline_1.default)(stream).on("data", (line) => logger_1.execLog.trace(line, { containerId: container.id }));
|
|
31
|
-
}
|
|
32
|
-
const exitCode = yield waitForExec(exec, stream);
|
|
33
|
-
stream.destroy();
|
|
34
|
-
return { output: chunks.join(""), exitCode };
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
logger_1.log.error(`Failed to exec container with command "${command.join(" ")}": ${err}: ${chunks.join("")}`, {
|
|
38
|
-
containerId: container.id,
|
|
39
|
-
});
|
|
40
|
-
throw err;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
exports.execContainer = execContainer;
|
|
44
|
-
const startExec = (dockerode, containerRuntime, exec, container) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
try {
|
|
46
|
-
const stream = yield exec.start({ stdin: true, Detach: false, Tty: true });
|
|
47
|
-
if (containerRuntime === "podman") {
|
|
48
|
-
return (0, demux_stream_1.demuxStream)(dockerode, stream);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
return stream;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
logger_1.log.error(`Failed to start exec: ${err}`, { containerId: container.id });
|
|
56
|
-
throw err;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
const waitForExec = (exec, stream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
-
yield new Promise((res, rej) => {
|
|
61
|
-
stream.on("end", res);
|
|
62
|
-
stream.on("error", rej);
|
|
63
|
-
});
|
|
64
|
-
const inspectResult = yield exec.inspect();
|
|
65
|
-
return inspectResult.ExitCode === null ? -1 : inspectResult.ExitCode;
|
|
66
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
import Dockerode from "dockerode";
|
|
7
|
-
export type GetContainerArchiveOptions = {
|
|
8
|
-
container: Dockerode.Container;
|
|
9
|
-
path: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const getContainerArchive: (options: GetContainerArchiveOptions) => Promise<NodeJS.ReadableStream>;
|
|
@@ -1,23 +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.getContainerArchive = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const getContainerArchive = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
try {
|
|
16
|
-
return yield options.container.getArchive({ path: options.path });
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
logger_1.log.error(`Failed to get archive from container: ${err}`, { containerId: options.container.id });
|
|
20
|
-
throw err;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
exports.getContainerArchive = getContainerArchive;
|
|
@@ -1,49 +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.getContainerByHash = exports.getContainerById = void 0;
|
|
13
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
14
|
-
const logger_1 = require("../../../logger");
|
|
15
|
-
const labels_1 = require("../../../labels");
|
|
16
|
-
const getContainerById = (id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
try {
|
|
18
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
19
|
-
return dockerode.getContainer(id);
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
logger_1.log.error(`Failed to get container by ID: ${err}`);
|
|
23
|
-
throw err;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
exports.getContainerById = getContainerById;
|
|
27
|
-
const getContainerByHash = (hash) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
-
try {
|
|
29
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
30
|
-
const containers = yield dockerode.listContainers({
|
|
31
|
-
limit: 1,
|
|
32
|
-
filters: {
|
|
33
|
-
status: ["running"],
|
|
34
|
-
label: [`${labels_1.LABEL_TESTCONTAINERS_CONTAINER_HASH}=${hash}`],
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
if (containers.length === 0) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return yield (0, exports.getContainerById)(containers[0].Id);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
logger_1.log.error(`Failed to get container by hash "${hash}": ${err}`);
|
|
46
|
-
throw err;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
exports.getContainerByHash = getContainerByHash;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HealthCheckStatus, Labels, NetworkSettings, Ports } from "../../types";
|
|
2
|
-
import Dockerode from "dockerode";
|
|
3
|
-
export type InspectResult = {
|
|
4
|
-
name: string;
|
|
5
|
-
hostname: string;
|
|
6
|
-
ports: Ports;
|
|
7
|
-
healthCheckStatus: HealthCheckStatus;
|
|
8
|
-
networkSettings: {
|
|
9
|
-
[networkName: string]: NetworkSettings;
|
|
10
|
-
};
|
|
11
|
-
state: {
|
|
12
|
-
status: string;
|
|
13
|
-
running: boolean;
|
|
14
|
-
startedAt: Date;
|
|
15
|
-
finishedAt: Date | undefined;
|
|
16
|
-
};
|
|
17
|
-
labels: Labels;
|
|
18
|
-
};
|
|
19
|
-
export declare const inspectContainer: (container: Dockerode.Container) => Promise<InspectResult>;
|