您的位置:首页 > 运维架构 > Docker

Docker快速入门--简单命令

2016-12-09 09:20 696 查看

相关链接:

原文链接:http://www.itbus.tech/detail.html?id=15

本文不涉及docker原理,运行机制等话题,只是以最快速的方式上手,之后会有介绍。本人喜欢先做起来,培养兴趣了,不要一开始就是一堆原理,唬的人一脸懵逼。

docker hub登陆

docker login

查看本地所有docker images

docker images

➜  docker docker images
REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
dubbyyoung/docker-whale-new   latest              cae0a8cca57f        12 hours ago        275.1 MB
hello-world                   latest              c54a2cc56cbb        5 months ago        1.848 kB
docker/whalesay               latest              6b362a9f73eb        18 months ago       247 MB


运行docker

docker run dubbyyoung/docker-whale-new

➜  docker docker run dubbyyoung/docker-whale-new
_________________________________________
/ The first rule of intelligent tinkering \
| is to save all the parts.               |
|                                         |
\ -- Paul Erlich                          /
-----------------------------------------
\
\
\
##        .
## ## ##       ==
## ## ## ##      ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
\______ o          __/
\    \        __/
\____\______/


打标签

docker tag cae0a8cca57f dubbyyoung/docker-whale-new:latest

push到docker hub

docker push dubbyyoung/docker-whale-new

标签打成你的repository/docker-name才能push

docker hub pull到本地

docker pull dubbyyoung/docker-whale-new

docker run的时候,如果本地没有找到image,会自动pull

构建docker

docker build -t docker-whale .

Dockerfile已经写好了,才可以执行这句命令

从本地删除docker

docker rmi -f cae0a8cca57f

docker rmi -f dubbyyoung/docker-whale-new
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  docker