docker下载ubuntu并进行修改后生成新的镜像提交

一  docker pull ubuntu ,先下载下来一个镜像,

或者 从本地启动一个镜像

docker run -i -t ubuntu /bin/bash

进入一定更新操作

# shell on container

$ apt-get update

$ apt-get -y install python-pip

$ pip install django

上面的操作是更新源,然后安装pip和django

更新镜像

docker commit -m="description about images" --author="author" {container_id} {repository/images_name:tag}

container_id为镜像本来的id,后面的repository可以写自己的名字,imgaes_name可以写ubuntu,tag可以写v2

 

四 从更新后的镜像中启动

docker run -d -t wang/ubuntu:v2 /bin/bash后台运行

或者 docker run -i -t wang/ubuntu:v2 /bin/bash 交互式运行

posted @ 2017-11-27 17:13  xqnq2007  阅读(295)  评论(0编辑  收藏  举报