1.首先更新资源update。
sudo apt-get update
2.安装docker。
sudo apt-get install docker
3.安装docker.io。
sudo apt-get install docker.io
4.安装docker-registry。
sudo apt-get install docker-registry
5.开始启动我们的docker
sudo systemctl start docker
6.把ubuntu14.04的镜像pull到本地(这里使用的ubuntu14.04,当然你也可以使用centos等其他版本)。
sudo docker pull ubuntu:14.04
7.完成后可以通过ubutnu14.04镜像创建一个容器。
sudo docker create ubuntu:14.04
8.开始运行容器,然就就可以尽情的在docker容器中使用shell了。
sudo docker run -i -t ubuntu:14.04 /bin/bash
8.1指定端口运行
9.结束运行容器
sudo docker stop 镜像id
sudo apt-get update
2.安装docker。
sudo apt-get install docker
3.安装docker.io。
sudo apt-get install docker.io
4.安装docker-registry。
sudo apt-get install docker-registry
5.开始启动我们的docker
sudo systemctl start docker
6.把ubuntu14.04的镜像pull到本地(这里使用的ubuntu14.04,当然你也可以使用centos等其他版本)。
sudo docker pull ubuntu:14.04
7.完成后可以通过ubutnu14.04镜像创建一个容器。
sudo docker create ubuntu:14.04
8.开始运行容器,然就就可以尽情的在docker容器中使用shell了。
sudo docker run -i -t ubuntu:14.04 /bin/bash
8.1指定端口运行
sudo docker run -p 8081:8081 --name 镜像名称 -it 镜像id
8.2 从镜像eafd9111ada6生成新的镜像docker/lua
sudo docker commit eafd9111ada6 docker/lua
9.结束运行容器
sudo docker stop 镜像id