在ubuntu上安装docker

 

1、我这边准备的系统是:

root@ubuntu:~# uname -a
Linux ubuntu 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

 

2、准备安装docker了
安装Docker使用apt-get命令:
$ apt-get install docker.io

 

3、向仓库拉取这个镜像 hello-world

docker pull hello-word

 

4、启动这个容器,打印出来了信息表示启动完毕。前台启动

docker run helle-world

后台启动例子:

-->启动 指定端口映射关系 外部的8080到容器的80
docker run -d -p 8080:80 hub.c.163.com/library/nginx

-->启动开放所有端口 随机的对应容器端口 可以通过docker ps 查看
docker run -d -P hub.c.163.com/library/nginx

 

-->基础命令,必须掌握。

docker pull
docker images
docker run
docker build
docker ps
docker exec
docker start
docker stop
docker restart

 

posted @ 2017-06-04 16:05  下一站你要去哪里  阅读(276)  评论(0编辑  收藏  举报