Skip to content

Commit 6c69276

Browse files
add
1 parent 46233a4 commit 6c69276

File tree

2 files changed

+55
-10
lines changed

2 files changed

+55
-10
lines changed

note/docker.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,54 @@
22

33
## 目录
44

5+
---
6+
## docker简介
57

6-
## docker的优点&安装
8+
### docker简介和优点
9+
10+
### docker的几个概念
11+
12+
* 镜像(image)
13+
14+
* 容器(container)
15+
16+
镜像(Image)和容器(Container)的关系,**就像是面向对象程序设计中的 类 和 实例 一样,镜像是静态的定义,容器是镜像运行时的实体。**容器可以被创建、启动、停止、删除、暂停等。
17+
18+
19+
前面讲过镜像使用的是分层存储,容器也是如此。**每一个容器运行时,是以镜像为基础层,在其上创建一个当前容器的存储层,我们可以称这个为容器运行时读写而准备的存储层为容器存储层。**
20+
21+
* 仓库(repository)
22+
23+
---
724

825
## 基本使用
926

27+
### 1. 获取镜像
28+
29+
Docker Hub 上有大量的高质量的镜像可以用,这里我们就说一下怎么获取这些镜像。
30+
31+
从 Docker 镜像仓库获取镜像的命令是 docker pull。其命令格式为:
32+
```
33+
docker pull [选项] [Docker Registry 地址[:端口号]/]仓库名[:标签]
34+
```
35+
36+
具体的选项可以通过 docker pull --help 命令看到,这里我们说一下镜像名称的格式。
37+
38+
* Docker 镜像仓库地址:地址的格式一般是 <域名/IP>[:端口号]。默认地址是 Docker Hub。
39+
* 仓库名:如之前所说,这里的仓库名是两段式名称,即 <用户名>/<软件名>。对于 Docker Hub,如果不给出用户名,则默认为 library,也就是官方镜像。
40+
41+
---
42+
43+
### 2. 运行
44+
1045
* 查看
1146
```
1247
docker image ls
1348
1449
docker ps
1550
51+
docker ps -a
52+
1653
docker stats
1754
```
1855

@@ -75,8 +112,6 @@ docker exec -it my_nginx bash
75112

76113
## 参考
77114

78-
1. https://yeasy.gitbooks.io/docker_practice/image/pull.html
79-
80-
2. https://www.jianshu.com/p/3384e342502b
115+
- [docker 入门到实践](https://yeasy.gitbooks.io/docker_practice/image/pull.html)
81116

82-
3. https://www.yuque.com/grasilife/docker
117+
- [使用Docker快速搭建Nginx+PHP-FPM环境](https://www.jianshu.com/p/3384e342502b)

note/linux命令.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
* [Linux 进阶](#linux进阶)
2020

21+
* [htop/top](#htop/top)
22+
2123
* [strace](#strace)
2224

2325
* [vmstat](#vmstat)
@@ -233,7 +235,7 @@ ulimit -c 1024 # 修改成1024,这样就可以产生core file了
233235
234236
## Linux 进阶
235237
236-
### htop/top命令
238+
### htop/top
237239
238240
top的一部分输出是:
239241
```
@@ -243,8 +245,14 @@ top的一部分输出是:
243245
```
244246
245247
```
246-
VIRT 的定义是:占用的虚拟内存的大小(占用的物理内存+swap空间)
248+
VIRT 的定义是:
249+
占用的虚拟内存的大小(占用的物理内存+swap空间)
250+
virt是virtual memory usage ,virt是virtual的前四个字母的缩写吧。
251+
virt表示的是申请到的内存,而不是使用的内存。(假如进程申请100m的内存,但实际只使用了10m,那么它会增长100m,而不是实际的使用量)
252+
247253
RES 表示的是:占用的物理内存
254+
进程常驻内存的大小,实际使用的物理内存
255+
248256
SHR 表示的是:占用的是共享内存
249257
```
250258
@@ -429,9 +437,11 @@ sudo perf top -g -p pid
429437
430438
## 参考资料
431439
432-
>[GDB 教程](https://wizardforcel.gitbooks.io/100-gdb-tips/set-follow-fork-mode-child.html)
440+
- [GDB 教程](https://wizardforcel.gitbooks.io/100-gdb-tips/set-follow-fork-mode-child.html)
441+
442+
- [linux tool quick tutorial](https://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html)
433443
444+
- [make教程](http://www.ruanyifeng.com/blog/2015/02/make.html)
434445
435-
>[linux tool quick tutorial](https://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html)
446+
- [一个关于内存分配的教程](https://blog.holbertonschool.com/category/hack-the-virtual-memory/)
436447
437-
>[make教程](http://www.ruanyifeng.com/blog/2015/02/make.html)

0 commit comments

Comments
 (0)