Skip to content

Commit

Permalink
Merge pull request #1174 from rwynn/master
Browse files Browse the repository at this point in the history
Ensure gateway IP is truthy before adding to docker args
  • Loading branch information
dherault committed Apr 13, 2022
2 parents 72ba379 + 84c0bf8 commit 3c70234
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lambda/handler-runner/docker-runner/DockerContainer.js
Expand Up @@ -179,7 +179,9 @@ export default class DockerContainer {
// Add `host.docker.internal` DNS name to access host from inside the container
// https://github.com/docker/for-linux/issues/264
const gatewayIp = await this._getBridgeGatewayIp()
dockerArgs.push('--add-host', `host.docker.internal:${gatewayIp}`)
if (gatewayIp) {
dockerArgs.push('--add-host', `host.docker.internal:${gatewayIp}`)
}
}

if (this.#dockerOptions.network) {
Expand Down

0 comments on commit 3c70234

Please sign in to comment.