Docker
English | 日本語
On Ubuntu 20.04¶
To install Docker¶
$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
$ apt-cache policy docker-ce
$ sudo apt install docker-ce
$ sudo systemctl status dockerExecuting the Docker Command Without Sudo¶
$ sudo usermod -aG docker ${USER}
$ su - ${USER}
$ groups
$ sudo usermod -aG docker {username}CLI¶
Mount¶
$ docker run \
--mount type=bind,source=/tmp,target=/usrDelete all containers¶
$ docker stop `docker ps -a -q`; docker rm `docker ps -a -q`
$ docker stop $(docker ps -q); docker rm $(docker ps -q -a); docker rmi $(docker images -q) --forceTroubleshooting¶
docker-credential-desktop is missing when using Colima¶
When running OpenHands Agent Canvas with the Colima Docker context, Docker may fail before pulling the image.
$ docker run -it --rm \
-p 8000:8000 \
-v ~/repository/.openhands:/home/openhands/.openhands \
-v ~/repository/projects:/projects \
ghcr.io/openhands/agent-canvas:latest
Unable to find image 'ghcr.io/openhands/agent-canvas:latest' locally
docker: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``The Docker engine can be working correctly with Colima, but Docker may still try to use the Docker Desktop credential helper if it remains in ~/.docker/config.json.
Check the current Docker environment first.
$ docker version
$ docker infoThen inspect the Docker config.
$ cat ~/.docker/config.json
{
"auths": {},
"credsStore": "desktop",
"currentContext": "colima"
}If credsStore is set to desktop, edit the config file.
$ nvim ~/.docker/config.jsonRemove this line.
"credsStore": "desktop",The config should look like this.
{
"auths": {},
"currentContext": "colima"
}After removing credsStore, Docker no longer calls the missing docker-credential-desktop binary. Run the container again, and the image pull should start normally.
$ docker run -it --rm \
-p 8000:8000 \
-v ~/repository/.openhands:/home/openhands/.openhands \
-v ~/repository/projects:/projects \
ghcr.io/openhands/agent-canvas:latest
Unable to find image 'ghcr.io/openhands/agent-canvas:latest' locally
latest: Pulling from openhands/agent-canvas
4da697f470bb: Pull complete
72c03230f136: Pull complete
...