Remove blank lines after code block markers

This commit is contained in:
yeasy
2026-03-21 22:36:09 -07:00
parent 312f8fea42
commit 9ac19d79ee
132 changed files with 0 additions and 1517 deletions

View File

@@ -9,7 +9,6 @@
```bash
docker pull [选项] [Registry地址/]仓库名[:标签]
```
#### 镜像名称格式
Docker 镜像名称由 Registry 地址用户名仓库名和标签组成其标准格式如下
@@ -21,7 +20,6 @@ docker.io / library / ubuntu : 24.04
Registry地址 用户名 仓库名 标签
(可省略) (可省略)
```
| 组成部分 | 说明 | 默认值 |
|---------|------|--------|
| Registry 地址 | 镜像仓库地址 | `docker.io` (Docker Hub)|
@@ -32,7 +30,6 @@ Registry地址 用户名 仓库名 标签
#### 示例
```bash
## 完整格式
$ docker pull docker.io/library/ubuntu:24.04
@@ -57,7 +54,6 @@ $ docker pull bitnami/redis:latest
$ docker pull ghcr.io/username/myapp:v1.0
```
---
### 4.1.2 下载过程解析
@@ -74,7 +70,6 @@ Digest: sha256:4bc3ae6596938cb0d9e5ac51a1152ec9dcac2a1c50829c74abd9c4361e321b26
Status: Downloaded newer image for ubuntu:24.04
docker.io/library/ubuntu:24.04
```
#### 输出解读
| 输出内容 | 说明 |
@@ -98,7 +93,6 @@ flowchart TD
L3 --- L2 --- L1
end
```
如果本地已有相同的层Docker 会跳过下载节省带宽和时间
---
@@ -120,7 +114,6 @@ flowchart TD
```bash
$ docker pull --platform linux/amd64 nginx
```
---
### 4.1.4 拉取后运行
@@ -128,7 +121,6 @@ $ docker pull --platform linux/amd64 nginx
拉取镜像后可以基于它启动容器
```bash
## 拉取镜像
$ docker pull ubuntu:24.04
@@ -141,7 +133,6 @@ PRETTY_NAME="Ubuntu 24.04 LTS"
...
root@e7009c6ce357:/# exit
```
**参数说明**
| 参数 | 说明 |
@@ -167,7 +158,6 @@ root@e7009c6ce357:/# exit
]
}
```
配置后重启 Docker
```bash
@@ -175,7 +165,6 @@ $ sudo systemctl restart docker # Linux
## 或在 Docker Desktop 中重启
```
详见[镜像加速器](../03_install/3.9_mirror.md)章节
---
@@ -191,7 +180,6 @@ $ docker images --digests ubuntu
REPOSITORY TAG DIGEST IMAGE ID
ubuntu 24.04 sha256:4bc3ae6596938cb0d9e5ac51a1152ec9dcac2a1c50829c74abd9c4361e321b26 ca2b0f26964c
```
#### 使用摘要拉取
用摘要拉取可确保获取完全相同的镜像
@@ -199,7 +187,6 @@ ubuntu 24.04 sha256:4bc3ae6596938cb0d9e5ac51a1152ec9dcac2a1c50829c74abd9
```bash
$ docker pull ubuntu@sha256:4bc3ae6596938cb0d9e5ac51a1152ec9dcac2a1c50829c74abd9c4361e321b26
```
> 笔者建议生产环境使用摘要而非标签因为标签可能被覆盖摘要则是不可变的
---
@@ -219,7 +206,6 @@ $ docker pull ubuntu@sha256:4bc3ae6596938cb0d9e5ac51a1152ec9dcac2a1c50829c74abd9
```bash
Error: pull access denied, repository does not exist
```
可能原因
- 镜像名拼写错误
@@ -229,7 +215,6 @@ Error: pull access denied, repository does not exist
#### Q磁盘空间不足
```bash
## 清理未使用的镜像
$ docker image prune
@@ -238,5 +223,4 @@ $ docker image prune
$ docker system prune
```
---