For Windows and Mac OS X there’s an easy new application called Docker Desktop that will contain everything you need, download it here. For Linux, just follow the guides here. If you want a GUI on Linux, and I would highly recommend it, install Portainer by running the following commands after installing docker:
$ docker volume create portainer_data$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
Testing Docker
After you’ve successfully installed Docker Desktop, open a terminal and run docker --version
to check the version of Docker installed on your machine.
$ docker --versionDocker version 19.03.5, build 633a0ea
Now you can run a pre-made docker image called hello-world to make sure everything works:
$ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world ca4f61b1923c: Pull complete Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. ...
Then run docker image ls
to see the hello-world
image that you downloaded to your machine. Also see any active containers by using the docker ps --all
command, or opening up the GUI you installed.
$ docker ps --all CONTAINER ID IMAGE COMMAND CREATED STATUS 54f4984ed6a8 hello-world "/hello" 10 seconds ago Exited (0) 19 seconds ago
You’re all set to start developing with Docker!