1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
## installation sudo apt-get install apparmor lxc cgroup-lite sudo apt-get install docker.io ## verification sudo service docker.io start sudo docker run hello-world ## show current images sudo docker images ## view location sudo cat /var/lib/docker/repositories-aufs | python -m json.tool ## change docker image installation directory sudo docker ps -q | xargs docker kill sudo service docker.io stop mkdir /your/path/to/docker && chmod 700 /your/path/to/docker sudo vim /etc/default/docker.io # add new line DOCKER_OPTS="-g /your/path/to/docker" ## as root: su chown root.root /your/path/to/docker mv /var/lib/docker/* /your/path/to/docker/ echo "image location moved, see /etc/default/docker.io for new location" > /var/lib/docker/README ## as normal user sudo service docker.io start sudo docker images ## hellow-world listed |