$ docker context use my-remote-docker-machine
Current context is now "my-remote-docker-machine"$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
my-remote-docker-machine * ssh://username@host
See the * is moved from default to my-remote-docker-machine. Now you can use your docker command without --context flag.
$ docker context use default # back to default$ docker context rm my-remote-docker-machine
Using docker context might help to avoid SSH manually to the remote server. But, when it comes to build an image using a remote docker locally, you need to consider how much docker context that will be uploaded/downloaded.
Thank you for reading!
Love This Content?
Any kind of supports is greatly appreciated! Kindly support me via Bitcoin, Ko-fi, Trakteer, or just continue to read another content. You can write a response via Webmention and let me know the URL via Telegraph.