Quick Guide to Docker

Here is a quick guide to using Docker. See also:

From: https://docs.docker.com/docker-for-windows/#docker-settings-dialog 

Printing the version

docker --version

Testing the installation

docker run hello-world

Listing the images

docker image ls

Listing all the containers

docker container ls --all

Other help

> docker --help
> docker container --help
> docker container ls --help
> docker run --help

Pull an image of the Ubuntu OS and run an interactive terminal inside the spawned container:

docker run --interactive --tty ubuntu bash

Pull and run a Dockerized nginx web server that we name, webserver:

docker run --detach --publish 80:80 --name webserver nginx

You can now point your browser to http://localhost and see that the nginx welcome page is loaded.

List only your running containers:

docker container ls

Stop the running nginx container by the name we assigned it, webserver:

docker container stop webserver

Start a container that was stopped/exited previously:

docker start webserver

Attached to a running container, webserver:

docker attach webserver

Remove all  containers by its name:

docker container rm webserver 

The following common starts an interactive ash command line session for the docker image alpine-npm, maps the internal port 3000 to the host port 3000, gives it a name “react”, and automatically removes the image upon exit:

docker run -p 3000:3000 -it --name react --rm alpine-npm /bin/ash

See the following page on how to display applications onto your Windows 10.

https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde