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
|
@@ -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.listContainers = void 0;
|
|
13
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
14
|
-
const logger_1 = require("../../../logger");
|
|
15
|
-
const listContainers = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
try {
|
|
17
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
18
|
-
return yield dockerode.listContainers();
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
logger_1.log.error(`Failed to list containers: ${err}`);
|
|
22
|
-
throw err;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
exports.listContainers = listContainers;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable } from "stream";
|
|
3
|
-
import Dockerode from "dockerode";
|
|
4
|
-
export type PutContainerArchiveOptions = {
|
|
5
|
-
container: Dockerode.Container;
|
|
6
|
-
stream: Readable;
|
|
7
|
-
containerPath: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const putContainerArchive: (options: PutContainerArchiveOptions) => Promise<void>;
|
|
@@ -1,26 +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.putContainerArchive = void 0;
|
|
13
|
-
const stream_1 = require("stream");
|
|
14
|
-
const logger_1 = require("../../../logger");
|
|
15
|
-
const stream_utils_1 = require("../../../stream-utils");
|
|
16
|
-
const putContainerArchive = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
try {
|
|
18
|
-
const stream = yield options.container.putArchive(options.stream, { path: options.containerPath });
|
|
19
|
-
yield (0, stream_utils_1.streamToString)(stream_1.Readable.from(stream));
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
logger_1.log.error(`Failed to put archive to container: ${err}`, { containerId: options.container.id });
|
|
23
|
-
throw err;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
exports.putContainerArchive = putContainerArchive;
|
|
@@ -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.removeContainer = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const removeContainer = (container, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
try {
|
|
16
|
-
yield container.remove({ v: options.removeVolumes });
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
logger_1.log.error(`Failed to remove container: ${err}`, { containerId: container.id });
|
|
20
|
-
throw err;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
exports.removeContainer = removeContainer;
|
|
@@ -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.restartContainer = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const restartContainer = (container, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
try {
|
|
16
|
-
yield container.restart({ t: options.timeout / 1000 });
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
logger_1.log.error(`Failed to restart container: ${err}`, { containerId: container.id });
|
|
20
|
-
throw err;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
exports.restartContainer = restartContainer;
|
|
@@ -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.startContainer = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const startContainer = (container) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
try {
|
|
16
|
-
yield container.start();
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
logger_1.log.error(`Failed to start container: ${err}`, { containerId: container.id });
|
|
20
|
-
throw err;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
exports.startContainer = startContainer;
|
|
@@ -1,29 +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.stopContainer = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const stopContainer = (container, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
try {
|
|
16
|
-
yield container.stop({ t: options.timeout / 1000 });
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
}
|
|
19
|
-
catch (err) {
|
|
20
|
-
if (err.statusCode === 304) {
|
|
21
|
-
logger_1.log.info(`Container has already been stopped`, { containerId: container.id });
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
logger_1.log.error(`Failed to stop container: ${err}`, { containerId: container.id });
|
|
25
|
-
throw err;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
exports.stopContainer = stopContainer;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLabels = void 0;
|
|
4
|
-
const labels_1 = require("../../labels");
|
|
5
|
-
const package_json_1 = require("../../../package.json");
|
|
6
|
-
const createLabels = (sessionId, reusable, extraLabels = {}) => {
|
|
7
|
-
const labels = Object.assign(Object.assign({}, extraLabels), { [labels_1.LABEL_TESTCONTAINERS]: "true", [labels_1.LABEL_TESTCONTAINERS_LANG]: "node", [labels_1.LABEL_TESTCONTAINERS_VERSION]: package_json_1.version });
|
|
8
|
-
if (!reusable) {
|
|
9
|
-
labels[labels_1.LABEL_TESTCONTAINERS_SESSION_ID] = sessionId;
|
|
10
|
-
}
|
|
11
|
-
return labels;
|
|
12
|
-
};
|
|
13
|
-
exports.createLabels = createLabels;
|
|
@@ -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.demuxStream = void 0;
|
|
13
|
-
const stream_1 = require("stream");
|
|
14
|
-
const logger_1 = require("../../logger");
|
|
15
|
-
const demuxStream = (dockerode, stream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
try {
|
|
17
|
-
const demuxedStream = new stream_1.PassThrough({ autoDestroy: true, encoding: "utf-8" });
|
|
18
|
-
dockerode.modem.demuxStream(stream, demuxedStream, demuxedStream);
|
|
19
|
-
stream.on("end", () => demuxedStream.end());
|
|
20
|
-
demuxedStream.on("close", () => {
|
|
21
|
-
if (!stream.destroyed) {
|
|
22
|
-
stream.destroy();
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return demuxedStream;
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
logger_1.log.error(`Failed to demux stream: ${err}`);
|
|
29
|
-
throw err;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
exports.demuxStream = demuxStream;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Dockerode from "dockerode";
|
|
2
|
-
export type DockerInfo = {
|
|
3
|
-
serverVersion: number;
|
|
4
|
-
operatingSystem: string;
|
|
5
|
-
operatingSystemType: string;
|
|
6
|
-
architecture: string;
|
|
7
|
-
cpus: number;
|
|
8
|
-
memory: number;
|
|
9
|
-
indexServerAddress: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const getDockerInfo: (dockerode: Dockerode) => Promise<DockerInfo>;
|
|
@@ -1,38 +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.getDockerInfo = void 0;
|
|
13
|
-
const logger_1 = require("../../logger");
|
|
14
|
-
const getDockerInfo = (dockerode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
const info = yield dockerode.info();
|
|
16
|
-
return {
|
|
17
|
-
serverVersion: info.ServerVersion,
|
|
18
|
-
operatingSystem: info.OperatingSystem,
|
|
19
|
-
operatingSystemType: info.OSType,
|
|
20
|
-
architecture: info.Architecture,
|
|
21
|
-
cpus: info.NCPU,
|
|
22
|
-
memory: info.MemTotal,
|
|
23
|
-
indexServerAddress: getIndexServerAddress(info),
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
exports.getDockerInfo = getDockerInfo;
|
|
27
|
-
// https://github.com/containers/podman/issues/17776
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
const getIndexServerAddress = (info) => {
|
|
30
|
-
if (isUndefinedOrEmpty(info.IndexServerAddress)) {
|
|
31
|
-
logger_1.log.debug("Index server address is not set, using default");
|
|
32
|
-
return "https://index.docker.io/v1/";
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return info.IndexServerAddress;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const isUndefinedOrEmpty = (value) => value === undefined || value.length === 0;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DockerImageName } from "../../../docker-image-name";
|
|
2
|
-
import { PullPolicy } from "../../../pull-policy";
|
|
3
|
-
import { BuildArgs, RegistryConfig } from "../../types";
|
|
4
|
-
export type BuildImageOptions = {
|
|
5
|
-
imageName: DockerImageName;
|
|
6
|
-
context: string;
|
|
7
|
-
dockerfileName: string;
|
|
8
|
-
buildArgs: BuildArgs;
|
|
9
|
-
pullPolicy: PullPolicy;
|
|
10
|
-
registryConfig: RegistryConfig;
|
|
11
|
-
cache: boolean;
|
|
12
|
-
deleteOnExit: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const buildImage: (sessionId: string, options: BuildImageOptions) => Promise<void>;
|
|
@@ -1,81 +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.buildImage = void 0;
|
|
16
|
-
const logger_1 = require("../../../logger");
|
|
17
|
-
const tar_fs_1 = __importDefault(require("tar-fs"));
|
|
18
|
-
const byline_1 = __importDefault(require("byline"));
|
|
19
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
20
|
-
const create_labels_1 = require("../create-labels");
|
|
21
|
-
const path_1 = __importDefault(require("path"));
|
|
22
|
-
const fs_1 = require("fs");
|
|
23
|
-
const dockerignore_1 = __importDefault(require("@balena/dockerignore"));
|
|
24
|
-
const buildImage = (sessionId, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
-
try {
|
|
26
|
-
logger_1.log.info(`Building image "${options.imageName.toString()}" with context "${options.context}"...`);
|
|
27
|
-
const isDockerIgnored = yield createIsDockerIgnoredFunction(options.context);
|
|
28
|
-
const tarStream = tar_fs_1.default.pack(options.context, {
|
|
29
|
-
ignore: (aPath) => {
|
|
30
|
-
const relativePath = path_1.default.relative(options.context, aPath);
|
|
31
|
-
if (relativePath === options.dockerfileName) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return isDockerIgnored(relativePath);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
40
|
-
const buildImageOptions = {
|
|
41
|
-
dockerfile: options.dockerfileName,
|
|
42
|
-
nocache: !options.cache,
|
|
43
|
-
buildargs: options.buildArgs,
|
|
44
|
-
t: options.imageName.toString(),
|
|
45
|
-
labels: (0, create_labels_1.createLabels)(sessionId, !options.deleteOnExit),
|
|
46
|
-
registryconfig: options.registryConfig,
|
|
47
|
-
pull: options.pullPolicy.shouldPull() ? "true" : undefined,
|
|
48
|
-
};
|
|
49
|
-
yield new Promise((resolve) => {
|
|
50
|
-
dockerode
|
|
51
|
-
.buildImage(tarStream, buildImageOptions)
|
|
52
|
-
.then((stream) => (0, byline_1.default)(stream))
|
|
53
|
-
.then((stream) => {
|
|
54
|
-
stream.setEncoding("utf-8");
|
|
55
|
-
stream.on("data", (line) => {
|
|
56
|
-
if (logger_1.buildLog.enabled()) {
|
|
57
|
-
logger_1.buildLog.trace(line, { imageName: options.imageName.toString() });
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
stream.on("end", () => resolve());
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
logger_1.log.info(`Built image "${options.imageName.toString()}" with context "${options.context}"`);
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
logger_1.log.error(`Failed to build image: ${err}`);
|
|
67
|
-
throw err;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
exports.buildImage = buildImage;
|
|
71
|
-
const createIsDockerIgnoredFunction = (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
-
const dockerIgnoreFilePath = path_1.default.join(context, ".dockerignore");
|
|
73
|
-
if (!(0, fs_1.existsSync)(dockerIgnoreFilePath)) {
|
|
74
|
-
return () => false;
|
|
75
|
-
}
|
|
76
|
-
const instance = (0, dockerignore_1.default)({ ignorecase: false });
|
|
77
|
-
const dockerIgnorePatterns = yield fs_1.promises.readFile(dockerIgnoreFilePath, { encoding: "utf-8" });
|
|
78
|
-
instance.add(dockerIgnorePatterns);
|
|
79
|
-
const filter = instance.createFilter();
|
|
80
|
-
return (aPath) => !filter(aPath);
|
|
81
|
-
});
|
|
@@ -1,37 +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.imageExists = void 0;
|
|
16
|
-
const async_lock_1 = __importDefault(require("async-lock"));
|
|
17
|
-
const existingImages = new Set();
|
|
18
|
-
const imageCheckLock = new async_lock_1.default();
|
|
19
|
-
const imageExists = (dockerode, imageName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
return imageCheckLock.acquire(imageName.toString(), () => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
if (existingImages.has(imageName.toString())) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
yield dockerode.getImage(imageName.toString()).inspect();
|
|
26
|
-
existingImages.add(imageName.toString());
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
if (err instanceof Error && err.message.toLowerCase().includes("no such image")) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
throw err;
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
37
|
-
exports.imageExists = imageExists;
|
|
@@ -1,48 +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.pullImage = void 0;
|
|
16
|
-
const logger_1 = require("../../../logger");
|
|
17
|
-
const image_exists_1 = require("./image-exists");
|
|
18
|
-
const get_auth_config_1 = require("../../../registry-auth-locator/get-auth-config");
|
|
19
|
-
const async_lock_1 = __importDefault(require("async-lock"));
|
|
20
|
-
const byline_1 = __importDefault(require("byline"));
|
|
21
|
-
const imagePullLock = new async_lock_1.default();
|
|
22
|
-
const pullImage = (dockerode, indexServerAddress, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
try {
|
|
24
|
-
return imagePullLock.acquire(options.imageName.toString(), () => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
-
var _a;
|
|
26
|
-
if (!options.force && (yield (0, image_exists_1.imageExists)(dockerode, options.imageName))) {
|
|
27
|
-
logger_1.log.debug(`Not pulling image "${options.imageName}" as it already exists`);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
logger_1.log.info(`Pulling image "${options.imageName}"...`);
|
|
31
|
-
const authconfig = yield (0, get_auth_config_1.getAuthConfig)((_a = options.imageName.registry) !== null && _a !== void 0 ? _a : indexServerAddress);
|
|
32
|
-
const stream = yield dockerode.pull(options.imageName.toString(), { authconfig });
|
|
33
|
-
return new Promise((resolve) => {
|
|
34
|
-
(0, byline_1.default)(stream).on("data", (line) => {
|
|
35
|
-
if (logger_1.pullLog.enabled()) {
|
|
36
|
-
logger_1.pullLog.trace(line, { imageName: options.imageName.toString() });
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
stream.on("end", resolve);
|
|
40
|
-
});
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
logger_1.log.error(`Failed to pull image "${options.imageName}": ${err}`);
|
|
45
|
-
throw err;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
exports.pullImage = pullImage;
|
|
@@ -1,28 +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.connectNetwork = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
15
|
-
const connectNetwork = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
try {
|
|
17
|
-
logger_1.log.info(`Connecting to network "${options.networkId}"...`, { containerId: options.containerId });
|
|
18
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
19
|
-
const network = dockerode.getNetwork(options.networkId);
|
|
20
|
-
yield network.connect({ Container: options.containerId, EndpointConfig: { Aliases: options.networkAliases } });
|
|
21
|
-
logger_1.log.info(`Connected to network "${options.networkId}"...`, { containerId: options.containerId });
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
logger_1.log.error(`Failed to connect to network "${options.networkId}": ${err}`, { containerId: options.containerId });
|
|
25
|
-
throw err;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
exports.connectNetwork = connectNetwork;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type CreateNetworkOptions = {
|
|
2
|
-
name: string;
|
|
3
|
-
driver: "bridge" | "overlay" | string;
|
|
4
|
-
checkDuplicate: boolean;
|
|
5
|
-
internal: boolean;
|
|
6
|
-
attachable: boolean;
|
|
7
|
-
ingress: boolean;
|
|
8
|
-
enableIPv6: boolean;
|
|
9
|
-
labels?: {
|
|
10
|
-
[key: string]: string;
|
|
11
|
-
};
|
|
12
|
-
options?: {
|
|
13
|
-
[key: string]: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare const createNetwork: (sessionId: string, options: CreateNetworkOptions) => Promise<string>;
|
|
@@ -1,39 +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.createNetwork = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
15
|
-
const create_labels_1 = require("../create-labels");
|
|
16
|
-
const createNetwork = (sessionId, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
try {
|
|
18
|
-
logger_1.log.info(`Creating network "${options.name}"...`);
|
|
19
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
20
|
-
const network = yield dockerode.createNetwork({
|
|
21
|
-
Name: options.name,
|
|
22
|
-
CheckDuplicate: options.checkDuplicate,
|
|
23
|
-
Driver: options.driver,
|
|
24
|
-
Internal: options.internal,
|
|
25
|
-
Attachable: options.attachable,
|
|
26
|
-
Ingress: options.ingress,
|
|
27
|
-
EnableIPv6: options.enableIPv6,
|
|
28
|
-
Options: options.options,
|
|
29
|
-
Labels: Object.assign(Object.assign({}, options.labels), (0, create_labels_1.createLabels)(sessionId, false)),
|
|
30
|
-
});
|
|
31
|
-
logger_1.log.info(`Created network "${options.name}"`);
|
|
32
|
-
return network.id;
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
logger_1.log.error(`Failed to create network: ${err}`);
|
|
36
|
-
throw err;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
exports.createNetwork = createNetwork;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const removeNetwork: (id: string) => Promise<void>;
|
|
@@ -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.removeNetwork = void 0;
|
|
13
|
-
const logger_1 = require("../../../logger");
|
|
14
|
-
const docker_client_1 = require("../../client/docker-client");
|
|
15
|
-
const removeNetwork = (id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
try {
|
|
17
|
-
logger_1.log.info(`Removing network "${id}"...`);
|
|
18
|
-
const { dockerode } = yield (0, docker_client_1.getDockerClient)();
|
|
19
|
-
const network = dockerode.getNetwork(id);
|
|
20
|
-
const { message } = yield network.remove();
|
|
21
|
-
if (message) {
|
|
22
|
-
logger_1.log.warn(message);
|
|
23
|
-
}
|
|
24
|
-
logger_1.log.info(`Removed network "${id}"`);
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
logger_1.log.error(`Failed to remove network "${id}": ${err}`);
|
|
28
|
-
throw err;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
exports.removeNetwork = removeNetwork;
|