...
Then run: docker run -it --rm -e DISPLAY=host.docker.internal:0 my-xeyes
Using Docker context
With the use of Docker Desktop and Docker CLI, they can show two different behaviors based upon the docker context
. A context is basically a way to view various damon setups.
For example, below shows 3 contexts associated with the default cli, desktop, and OrbStack:
Code Block |
---|
$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * Docker Desktop unix:///Users/<user>/.docker/run/docker.sock
orbstack OrbStack unix:///Users/<user>/.orbstack/run/docker.sock |
Note: * signifies the context used in the terminal
A typical issue would be if you run Docker Desktop, and it shows certain images or containers, but docker cli does not. This means that you're in the wrong context!
Some scripts may require certain context to be set. It is highly suggested that if you use Docker Desktop, to make sure your context is set to desktop-linux
over default.