There are many good cheat sheets out there. This one is a collection of commands and notes I find myself referring to relatively frequently.
docker container prune
It will report an error about any running containers, since this attempts to remove them too Note: This will remove ALL containers, including volume data containers. You might not want this
docker ps -qa | xargs docker rm
sudo docker ps -qa | sudo xargs docker rm
docker image prune --force
docker rmi $(docker images | grep "<none>" | awk "{print \$3}")
docker images | grep "<none>" | awk "{print $3}" | xargs docker rmi
docker images | awk '{print $1}' | xargs -L1 docker pull
docker images | awk '(NR>1) && ($2!~/none/) {print $1}' | xargs docker pull
docker pull $(docker images | awk '(NR>1) && ($2!~/none/) {print $1}')
docker volume prune --force
docker volume ls -qf dangling=true | xargs docker volume rm
docker run --rm -v source-volume:/from:ro -v dest-volume:/to debian cp -TR /from /to
docker save myusername/myproject:latest | gzip -c > myproject.tar.gz
docker load < image.tar.gz
docker load --input image.tar.gz
docker system df -v
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
Start the container with -p 5005:5005
and pass gradle the command --debug-jvm
It will wait for the debugger to attach to the socket before running tests
> curl https://registry.host/v2/_catalog
{"repositories":["repository-name"]}
> curl https://registry.host/v2/oit/docfinity/tags/list
{"name":"repository-name","tags":["1.0.0"]}
If Hyper-V machines and disks are moved to a different location, make sure the Hyper-V Administrators group has write access to C:\ProgramData\Microsoft\Windows\Hyper-V. It needs it to create symlinks to the new location
If Docker can't find the location to mount on the host, it mounts the volume as a directory in the container. This can make it seem like a Docker is turning a file into a directory, if the file can't be found. This will happen if you try to use a relative path; the -v command must be given an absolute path (but docker compose can have relative paths) More here: https://stackoverflow.com/questions/34134343/single-file-volume-mounted-as-directory-in-docker