Can I control the address the sandbox is binding to when starting up?

I’m running the sandbox inside a Docker container and it seems to bind to localhost, which doesn’t allow me to access the process from the outside. Is there a way to control that? I skimmed the documentation but could find anything.

2 Likes

By default sandbox listens on localhost. You can change that using daml sandbox --address 0.0.0.0 (-a 0.0.0.0 works as a short form) to listen on all interfaces or specify a specific external IP that you want to listen on.

3 Likes

Thanks, that did the trick. My docker run command looks as follows:

docker run -p 6865:6865 digitalasset/daml-sdk:1.0.1 /bin/bash -c 'daml sandbox --address=0.0.0.0 --ledgerid=test'

Note that I had to use -p 6865:6865, if I just use -p 6865 it doesn’t work. I’m not sure the difference, but I’m no docker expert.

If you omit the host port, docker expose the given container port on a random port on the host. You can use docker port <containername> to see the mapping.