Skip to content

Instantly share code, notes, and snippets.

@decal
Forked from RichoDemus/gist:ebe6810e1a765e41b0d45f3585a14fb3
Last active April 27, 2018 07:31
Show Gist options
  • Save decal/66846d494188524cb1ea6dcd765825f7 to your computer and use it in GitHub Desktop.
Save decal/66846d494188524cb1ea6dcd765825f7 to your computer and use it in GitHub Desktop.
🐳 Handy Docker things

docker save | ssh user@host 'docker load'

docker images | egrep "^" | nawk '{ print $3 } ' | xargs docker rmi

docker system prune

docker volume rm $(docker volume ls -qf dangling=true)

OSX remove VM Disk since it doesn't auto-shrink

docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker volume rm $(docker volume ls |awk '{print $2}')
rm -rf ~/Library/Containers/com.docker.docker/Data/*

TODO clean this up:

richo@richo-lappy:~$ cat /etc/systemd/system/docker.service.d/richo.conf [Service] ExecStart= ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2375 -H fd://

init.d:

echo 'DOCKER_OPTS="--dns 10.72.4.130 -H tcp://127.0.0.1:2375"' > /etc/default/docker

systemd:

#make sure /etc/systemd/system/docker.service.d exists otherwise use mkdir to create it printf "[Service]\nExecStart=\nExecStart=/usr/bin/docker daemon -H tcp://127.0.0.1:2375 -H fd:// \n" > /etc/systemd/system/docker.service.d/docker.conf

Mac connect to docker VM

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment