summaryrefslogtreecommitdiffstats
path: root/docker/run-vespa.sh
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@yahoo-inc.com>2016-12-14 00:35:30 +0100
committerArnstein Ressem <aressem@yahoo-inc.com>2016-12-14 00:35:30 +0100
commit89b5d6ca4de4a42302b55c5ee295c49971646015 (patch)
treef6ca4dea53796648c357e42dc36c6dd4f8a719b6 /docker/run-vespa.sh
parent1717176e231cd4c97791498ebdf31e3085fca272 (diff)
Expose ports on OS X as net=host does not work as expected.
Diffstat (limited to 'docker/run-vespa.sh')
-rwxr-xr-xdocker/run-vespa.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/docker/run-vespa.sh b/docker/run-vespa.sh
index e11324a7b93..91fc88489e5 100755
--- a/docker/run-vespa.sh
+++ b/docker/run-vespa.sh
@@ -13,5 +13,10 @@ VESPA_VERSION=$1
DOCKER_IMAGE=vesparun
docker build -t "$DOCKER_IMAGE" -f Dockerfile.run .
-docker run -d -v $(pwd)/..:/vespa --net=host --privileged --entrypoint /vespa/docker/run-vespa-internal.sh "$DOCKER_IMAGE" "$VESPA_VERSION"
+if [ "$(uname)" != "Darwin" ]; then
+ docker run -d -v $(pwd)/..:/vespa --net=host --privileged --entrypoint /vespa/docker/run-vespa-internal.sh "$DOCKER_IMAGE" "$VESPA_VERSION"
+else
+ # On OS X, net=host does not work. Need to explicitly expose ports from localhost into container.
+ docker run -d -p 8080:8080 -p 19071:19071 -v $(pwd)/..:/vespa --privileged --entrypoint /vespa/docker/run-vespa-internal.sh "$DOCKER_IMAGE" "$VESPA_VERSION"
+fi