category: docker

Docker - Mac research log

on 2015-05-15

Docker - Mac research log

Install by Mac

Register Docker Hub

Docker Hub

Use Kitematic

kitematic

Install Ubuntu

Search ubuntu on docker hub

螢幕快照_2015-05-27_上午12_36_02.png

Run command

螢幕快照_2015-05-27_上午12_36_51.png

docker pull ubuntu

Use docker images

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              latest              07f8e8c5e660        3 weeks ago         188.3 MB

build dockerfile

docker build . -t ubuntu_dev:16.04 -f local.Dockerfile

run container

docker run -t -i ubuntu /bin/bash

docker run -t -i ubuntu /bin/bash
root@b0cdeb409841:/#

docker run

docker run -idt --name <container name> -v <mount absolute path or ~ path>:<docker path> <IMAGE>:<TAG>

end container

exit

show container

docker ps -a

show running container

docker ps

show images

docker images

enter docker container

docker exec -it <container id> bash

show log

docker logs <container id>

Read more