#
Add a Docker image to Docker Desktop (from Docker Hub)
This tutorial explains to you how to add a Docker image to Docker Desktop from Docker Hub.
This is done very simple. We need to use the docker pull
command.
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Options:
--all-tags , -a
: Download all tagged images in the repository--disable-content-trust
: Skip image verification--platform
: Set platform if server is multi-platform capable--quiet , -q
: Suppress verbose output
Options:
NAME
is the name of the image (from Docker Hub)- TAG is the tag of the image. Could be
latest
for the latest image we have in the repository.
If you are behind an HTTP proxy server, for example in corporate settings, before open a connection to registry, you may need to configure the Docker daemon’s proxy settings, using the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables.
In our case I will add an Envoy proxy image to our Docker Desktop using
pull envoyproxy/envoy-dev:d036285f8843fc7fd275f5d4f38a8ce040714ab1
the command:
Immediately we can see it in Docker Desktop:
We can see the image, but the image is not used yet to start a container.
In order to start the Envoy container you can run the following command:
docker run --rm -it -p 9901:9901 -p 10000:10000 envoyproxy/envoy-dev:d036285f8843fc7fd275f5d4f38a8ce040714ab1
Info
-p port1:port2
option maps a host port ("port1") to a container port("port2").