Public Repository

Last pushed: 12 days ago
Short Description
Apache Spark image.
Full Description

Docker Machine Commands

docker-machine create --driver virtualbox --virtualbox-disk-size 10000 --virtualbox-memory 2048 --virtualbox-cpu-count 4 <MACHINE NAME>

eval "$(docker-machine env <MACHINE NAME>)"

Push to insecure registry:

  • Log into the docker machine docker-machine ssh <MACHINE NAME>
  • Change to root sudo -i
  • Edit or create the file /var/lib/boot2docker/profile and add the following line to EXTRA_ARGS: --insecure-registry <REGISTRY HOST>:<REGISTRY PORT>
  • Restart Docker daemon: sudo /etc/init.d/docker restart

docker-machine ip <MACHINE NAME>

docker-machine restart <MACHINE NAME>

Docker Commands

docker ps -al

docker commit <CONTAINER ID> <IMAGE ID>

docker rm -f <CONTAINER ID>

docker rmi -f <IMAGE ID>

docker build -t <REPOSITORY NAME>/<IMAGE NAME>:<TAG NAME> <DOCKERFILE PATH>

docker run -it -p <HOST PORT>:<CONTAINER PORT> -v <HOST DIR>:<CONTAINER DIR> -e <KEU>=<VALUE> <CONTAINER ID>

docker exec -it <CONTAINER ID> /bin/bash

docker inspect <CONTAINER ID> | grep "\"IPAddress\"" | head -1 | awk '{print $2}'

docker run -d -v ~/Workspace/docker/couchbase:/opt/couchbase/var -p 8091:8091 couchbase/server[:community]

Stop and remove all containers:

docker ps -a | awk '!/CONTAINER/ {system("docker rm -f "$1)}'

Delete orphan images:

docker images | awk '$1~/none/ {system("docker rmi -f "$3)}'

Free local disk space:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -v /var/lib/docker:/var/lib/docker martin/docker-cleanup-volumes

Mount Host Directory from OS X:

vboxmanage showvminfo dev

From host:
vboxmanage sharedfolder add <MACHINE NAME> --name <NAME OF SHARED DIR> --hostpath <PATH TO SHARED DIR> --transient

docker-machine ssh <MACHINE NAME>

In Docker machine VM:

mkdir <PATH TO SHARED DIR>

sudo mount -t vboxsf -o uid=$(id -u docker),gid=$(id -g docker) <NAME OF SHARED DIR> <PATH TO SHARED DIR>

sudo umount <PATH TO SHARED DIR>

Create a Patch:

diff -abBu <ORIGINAL FILE> <MODIFIED FILE>

Useful References

Developing Inside Docker Containers with OS X

Docker - Beginner's tutorial

Arun Gupta's Docker Images

Docker Pull Command
Owner
asarkar

Comments (0)