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.04download latest ubuntu imagedocker imageslist all imagesdocker rundeamon 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 psshow containers just running
docker ps -ashow all containers (default shows just running)docker startstart one or more stopped containersdocker stopstop one or more running containersdocker killkill one or more running containersdocker rmremove one or more containersdocker rmiremove one or more imagesdocker port xxxxlist 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