Docker 入门(Mac环境)-part 1 入门基本操作
part-1 入门基本操作
Docker 安装
- 去官网下载对应的版本,然后点击安装就可以了;
- 如果环境是Linux,可以参照之前写的get started教程
查看docker版本
docker --version,很多软件版本都是这样检测,很容易记住的。如果打docker version,会得到更加详细的信息
➜ ~ docker --version
Docker version 17.12.0-ce, build c97c6d6
➜ ~ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:03:51 2017
OS/Arch: darwin/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true
docker info会得到比docker version更加详细的信息,如下:
➜ ~ docker info
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 1
Server Version: 17.12.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: VSOE:2YDP:C37G:UPUK:6Z47:NMMQ:2HFG:6RQF:IUAA:BJPX:X3QK:PSIL
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 22
Goroutines: 41
System Time: 2018-07-09T08:25:19.054780468Z
EventsListeners: 2
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
检查Docker的安装
- 可以通过运行一个简单的docker镜像来检测docker是否安装成功,命令是很常见的hello world,
docker run hello-world
➜ ~ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
9bb5a5d4561a: Pull complete
Digest: sha256:3e1764d0f546ceac4565547df2ac4907fe46f007ea229fd7ef2718514bcec35d
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
- 可以看到实际上开始机器上并没有安装hello-world这个镜像,他自动从docker-hub上下载了一个,然后启动了,下面的文字叙述了一下整个过程,还提示可以再试一下ubuntu的bash,等
- 可以使用ls命令来看看本机有哪些镜像,
docker image ls
➜ ~ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest e38bc07ac18e 2 months ago 1.85kB
docker container ls可以用来查看正在运行的容器,加--all参数可以看运行的历史
➜ ~ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
➜ ~ docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cbcd0f49f39d hello-world "/hello" 4 minutes ago Exited (0) 4 minutes ago epic_poincare
14ade628e65a hello-world "/hello" 18 minutes ago Exited (0) 18 minutes ago flamboyant_bell
d0a7facb8e31 hello-world "/hello" 18 minutes ago Exited (0) 18 minutes ago cranky_cray
docker container ls -aq,在清爽模式下查看所有的进程历史(all in quiet mode)
➜ ~ docker container ls -aq
cbcd0f49f39d
14ade628e65a
d0a7facb8e31
Docker 入门(Mac环境)-part 1 入门基本操作的更多相关文章
- docker for mac
MacOS上通过docker部署 docker环境准备 1.访问这里安装好docker,需要注册账号才能下载dmg安装包:https://hub.docker.com/editions/communi ...
- mac下通过docker搭建LEMP环境
在mac下通过docker搭建LEMP环境境 1.安装virtualbox.由于docker是在lxc环境的容器 2.安装boot2docker,用于与docker客户端通讯 > brew up ...
- Docker 学习新手笔记:从入门到放弃
本文记录的是作为一个新手,从了解 Docker 是什么.Docker 技术包含哪些概念到上手使用.安装以及发布 Docker 镜像的整个过程.作者在学习过程中参阅了诸多文档和教程,在此一并感谢,与此同 ...
- visual studio 2015 搭建python开发环境,python入门到精通[三]
在上一篇博客Windows搭建python开发环境,python入门到精通[一]很多园友提到希望使用visual studio 2013/visual studio 2015 python做demo, ...
- 【个人笔记】003-PHP基础-01-PHP快速入门-03-PHP环境搭建
003-PHP基础-01-PHP快速入门 03-PHP环境搭建 1.客户端(浏览器) IE FireFox CHROME Opera Safari 2.服务器 是运行网站的基本 是放置程序代码的地方 ...
- Android菜鸟的成长笔记(1)——Android开发环境搭建从入门到精通
原文:Android菜鸟的成长笔记(1)--Android开发环境搭建从入门到精通 今天在博客中看到好多Android的初学者对Android的开发环境的搭建不熟悉而导致不能进行学习,所以我决定自己写 ...
- 明晚8点,捷微团队QQ群公开课,解说jeewx2.0版本号maven环境的搭建入门!
2014-08-13号晚8点,捷微团队QQ群公开课,解说jeewx2.0版本号maven环境的搭建入门! 讲师:刘强(团队成员) QQ群:287090836 (JAVA版本号微信开源项目) http: ...
- Android入门之环境搭建
欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/1376935560.html 原创:An ...
- Spark+ECLIPSE+JAVA+MAVEN windows开发环境搭建及入门实例【附详细代码】
http://blog.csdn.net/xiefu5hh/article/details/51707529 Spark+ECLIPSE+JAVA+MAVEN windows开发环境搭建及入门实例[附 ...
随机推荐
- (原)SphereFace及其pytorch代码
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/8524937.html 论文: SphereFace: Deep Hypersphere Embeddi ...
- Ubuntu 12.04安装VMware Workstation8.0.3
2012-06-18 12:52 Ubuntu安装VMware Workstation8.0.3 由于使用Ubuntu的人比较少,网上关于Ubuntu的资料也很少,笔者在安装VMware Wo ...
- IDEA导入项目jar包红线, cannot resolve symbol xxxx问题
简单来说遇到的这种情况2种方式解决了, 不知道还有没有其他原因的. 1.reimport包 2.清缓存重启 针对1方法: a.确实不缺包: 可以先注释掉pom文件中的jar包, 此时idea会提示im ...
- LATeX 插入脚注
LATeX 插入脚注: 使用 \footnote{...注释内容} 命令: To maximize the lower-bound $ we employ conjugate gradient me ...
- VC设置视图背景颜色方法
视图的背景一般来说是白色的,在缺省情况下,它和系统定义的颜色COLOR_WINDOW是一致的.设计者一般会希望自己的程序可以让用户轻松地改变窗口背景颜色,或是用漂亮的图片来充填背景.我们可以用Wind ...
- XSS安全处理
Security.class.php文件 <?php class Security { public $filename_bad_chars = array( '../', '<!--', ...
- 【Android】Android实现Handler异步详解
方式不止一种,这里使用的是Timer类,创建一个定时器.我们经常需要获得移动设备端口的显示屏信息,但是onCreate()方法执行的时候,OnShow()方法不一定执行了,也就是说,在执行Oncrea ...
- poj3041(最小顶点覆盖)
链接:点击打开链接 题意:N*N的矩阵中有一些点代表陨石.每次仅仅能消灭一行或一列连,问须要多少次才干所有消灭 代码: #include <map> #include <queue& ...
- ArcGIS 10.2数字化线状要素时自己主动拼接成一条线
一開始一直和捕捉和经典捕捉过不去.最后才发现找错了地方,原来要Customize.自己定义加入"Continue Feature"工具,将其拖动到界面上的随意工具条内就可以.如图1 ...
- 关于switch语句中使用String类型的实现原理
在Java 7 以后,switch语句可以用作String类型上. 从本质来讲,switch对字符串的支持,其实也是int类型值的匹配.它的实现原理如下: 通过对case后面的String对象调用ha ...