test: update docker config for windows support (#2721

There is legacy support for PortBindings and Binds at the root level of
the config.  Currently (including Windows) these reside under the
HostConfig.  ExposedPorts is now used to identify the externally
available ports.

Signed-off-by: Chris. Webster <chris@webstech.net>
This commit is contained in:
Chris. Webster 2023-03-03 15:09:19 -08:00 committed by GitHub
parent 6ead75bf73
commit c04e827757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -23,7 +23,10 @@ export async function start() {
container = await docker.createContainer({
Tty: true,
Image: IMAGE,
PortBindings: {[`${SERVER_PORT}/tcp`]: [{HostPort: `${HOST_PORT}`}]},
HostConfig: {
PortBindings: {[`${SERVER_PORT}/tcp`]: [{HostPort: `${HOST_PORT}`}]}
},
ExposedPorts: {[`${SERVER_PORT}/tcp`]: {}}
});
await container.start();

View File

@ -19,7 +19,10 @@ export async function start() {
container = await docker.createContainer({
Tty: true,
Image: IMAGE,
PortBindings: {[`${MOCK_SERVER_PORT}/tcp`]: [{HostPort: `${MOCK_SERVER_PORT}`}]},
HostConfig: {
PortBindings: {[`${MOCK_SERVER_PORT}/tcp`]: [{HostPort: `${MOCK_SERVER_PORT}`}]}
},
ExposedPorts: {[`${MOCK_SERVER_PORT}/tcp`]: {}}
});
await container.start();

View File

@ -25,8 +25,11 @@ export async function start() {
container = await docker.createContainer({
Tty: true,
Image: IMAGE,
PortBindings: {[`${REGISTRY_PORT}/tcp`]: [{HostPort: `${REGISTRY_PORT}`}]},
Binds: [`${path.join(__dirname, 'config.yaml')}:/verdaccio/conf/config.yaml`],
HostConfig: {
PortBindings: {[`${REGISTRY_PORT}/tcp`]: [{HostPort: `${REGISTRY_PORT}`}]},
Binds: [`${path.join(__dirname, 'config.yaml')}:/verdaccio/conf/config.yaml`],
},
ExposedPorts: {[`${REGISTRY_PORT}/tcp`]: {}}
});
await container.start();