Saturday, January 28, 2017

windows docker

Windows 10 only
enable hyper-v
install docker

docker run -it --entrypoint=/bin/bash dharm0us/ubuntu
Ctrl-PQ to quit without killing container

docker images to list images
docker ps to list containers
docker attach <container-id>

docker tag <image-id> dharm0us/ubuntu:latest
docker login
docker push dharm0us/ubuntu:latest

docker commit -m"test commit" <container-id> dharm0us/ubuntu:latest
docker push dharm0us/ubuntu:latest

Share directory
 docker run -v //c/projects:/projects  -it --entrypoint=/bin/bash dharm0us/ubuntu

Run with sudo
 docker run --privileged  -v //c/projects:/projects  -it --entrypoint=/bin/bash dharm0us/ubuntu

Run with port mapped
docker run --privileged -p 80:80 -v //c/projects:/projects  -it --entrypoint=/bin/bash dharm0us/ubuntu

Inspect container config
docker inspect <container_id>

No comments:

Blog Archive