Skip to content

Commit

Permalink
test: update docker config for windows support (#2721
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
webstech committed Mar 3, 2023
1 parent 6ead75b commit c04e827
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion test/helpers/gitbox.js
Expand Up @@ -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();

Expand Down
5 changes: 4 additions & 1 deletion test/helpers/mockserver.js
Expand Up @@ -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();

Expand Down
7 changes: 5 additions & 2 deletions test/helpers/npm-registry.js
Expand Up @@ -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();
Expand Down

0 comments on commit c04e827

Please sign in to comment.