RedRoserade / docker-dart-sample

A sample Docker image of a Dart server

Home Page:https://registry.hub.docker.com/u/kevmoo/docker-dart-sample/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run a simple Dart server in Docker

docker run -d -P kevmoo/docker-dart-sample dart bin/server.dart
  • -d Run the image "detached".
  • -P Expose all of the requested ports. Just 8080 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.

Access the sample server.

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.

Shutting down the server.

Use the container ID or the friendly name. Given the example above, either:

docker kill f3b1d400fb81

or

docker kill desperate_lovelace

Sample source

The image lives in the Docker registry at kevmoo/docker-dart-sample.

The source is on GitHub at kevmoo/docker-dart-sample.

About

A sample Docker image of a Dart server

https://registry.hub.docker.com/u/kevmoo/docker-dart-sample/

License:BSD 3-Clause "New" or "Revised" License