Version
$docker --version
Docker version 1.12.0, build 8eab29e$
docker-compose --version
docker-compose version 1.8.0, build f3628c7$
docker-machine --version
docker-machine version 0.8.0, build b85aac1docker pull ubuntu:14.04
download latest ubuntu imagedocker images
list all imagesdocker run
deamon mode :
docker run -d -p 80:80 [ubuntu(image name)] --name webserver nginx
-d : Run container in background and print container ID
-p : Publish a container’s port(s) to the host
80: out/ 80: in
–name : Assign a name to the container
nginx : IMAGEinteractive mode :
docker run -it ubuntu:14.04 | bash
(啟動一台 ubuntu instance,並且切入bash模式)
-i: interactive mode, 讓操作者擁有互動模式
-t: terminal, 讓操作者可以使用終端機操作 instance
docker ps
show containers just running
docker ps -a
show all containers (default shows just running)docker start
start one or more stopped containersdocker stop
stop one or more running containersdocker kill
kill one or more running containersdocker rm
remove one or more containersdocker rmi
remove one or more imagesdocker port xxxx
list port mappings or a specific mapping for the running container
Ubuntu Commands
- sudo apt-get update
- sudo apt-get dist-upgrade
No comments:
Post a Comment