Docker
My docker notes
Install under Windows
- Download "Docker Toolbox" for Windows if your system does not meet the minimum requirements for the native Windows version.
- If you are using a proxy you have two options:
- set proxy environment variables in your Windows
- manually download the boot2docker.iso file and place it under "C:Users<user>.dockermachinemachinesdefault"
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 |
- Graphical apps in Docker
Sometimes we get tools that only run in specific distributions of linux, or that need specific libraries we don't have in the current installed release, or we just want to keep our system clean.
By using Docker we can fulfill all those goals. For backend appliccations it already is done very often but it is also possible to use Docker for graphical apps.
For example: