docker run -d -P kevmoo/docker-dart-sample dart bin/server.dart
-d
Run the image "detached".-P
Expose all of the requested ports. Just8080
for this image.kevmoo/docker-dart-sample
The image to load. If you don't have it, it will be downloaded.dart bin/server.dart
The command to run in the newly created container.dart
is in the PATH environment.bin/server.dart
is the server entry point.
To access the server, you need to know the IP and port to give your browser.
If you're running Docker directly (on Linux) then you can likely use localhost
.
Otherwise, you should be using boot2docker
. You can determine the IP address of the server
using boot2docker ip
.
A common value from boot2docker ip
is 192.168.59.103
.
To get the port, use docker ps
.
~/> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f3b1d400fb81 kevmoo/docker-dart-sample:latest dart bin/server.dart 7 minutes ago Up 7 minutes 0.0.0.0:49153->8080/tcp desperate_lovelace
Here you can see the host port 49153
is mapped to the container port 8080
.
So plug in these values into your favorite browser.
In my case: http://192.168.59.103:49153
.
Use the container ID or the friendly name. Given the example above, either:
docker kill f3b1d400fb81
or
docker kill desperate_lovelace
The image lives in the Docker registry at kevmoo/docker-dart-sample.
The source is on GitHub at kevmoo/docker-dart-sample.