docker run -d -e "container=docker" --privileged=true 280779378/myenv:v1.0 /usr/sbin/init
docker exec -it id bash
# 启动redis服务
service redis start
# 启动mongo服务
service mongod start
容器创建镜像
执行docker commit -a “lgq” -m “test commit” c1abdc177915 xinaml/myjava:v1.0命令提交镜像到本地(这个跟git的其实是一样的,先提交镜像到本地,才能推送到你的远程镜像仓库,一定要注意提交的镜像名格式 帐号/名字:如 xinaml/myjava,否则无法推送)
解释以下上面命令的信息:
-a “lgq”为创建镜像的作者名字 -m “test commit”为提交信息 c1abdc177915 为容器id,xinaml/myjava为镜像名,v1.0为tag
image.png
提交远程仓库
docker push 镜像名