Docker

My docker notes

Install under Windows

Commands

docker-system ssh default Open an SSH terminal session to the boot2docker machine
docker pull <image> Download a docker image
docker images Show list of docker images
docker run --name <name> -it <image> Start image with a custom container name
docker rm <container> Remove container

Set Proxy in boot2docker

Edit "/var/lib/boot2docker/profile" and add lines like:

   EXTRA_ARGS='
   --label provider=virtualbox

   '
   CACERT=/var/lib/boot2docker/ca.pem
   DOCKER_HOST='-H tcp://0.0.0.0:2376'
   DOCKER_STORAGE=aufs
   DOCKER_TLS=auto
   SERVERKEY=/var/lib/boot2docker/server-key.pem
   SERVERCERT=/var/lib/boot2docker/server.pem

   export http_proxy=http://<proxy>:<port>
   export https_proxy=http://<proxy>:<port>

vSphere

docker plugin install --grant-all-permissions --alias vsphere vmware/docker-volume-vsphere:latest Install the docker plugin to be able to access vSphere volumes
docker volume create --driver=vsphere --name=MyVolume -o size=10gb Create volume
docker volume ls List existing volumes
docker volume rm MyVolume Remove the volume
docker run --rm -it -v MyVolume:/mnt/myvol busybox Run a busybox image with the mounted volume