-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48413ef
commit f703ba6
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,6 +234,31 @@ docker rmi $(docker images | grep none | awk '{print $3}' | sort -r) | |
docker run -t -i nginx:latest /bin/bash | ||
``` | ||
|
||
## 下载镜像本地安装镜像 | ||
|
||
由于国区已经无法访问,可以将镜像打包,直接安装镜像压缩文件 | ||
|
||
```sh | ||
$ docker pull gitlab/gitlab-ce:17.0.1-ce.0 # 下载镜像 | ||
# 保存 Docker 镜像到本地文件 | ||
$ docker save -o [output-file.tar] [image-name] | ||
$ docker save -o gitlab-ce-17.0.1.tar gitlab/gitlab-ce | ||
``` | ||
|
||
将镜像文件发送到服务器 | ||
|
||
```sh | ||
$ scp [output-file.tar] [user]@[server-ip]:[path] | ||
$ scp gitlab-ce-17.0.1.tar [email protected]:/home/docker-images | ||
``` | ||
|
||
服务器上加载 Docker 镜像 | ||
|
||
```sh | ||
$ docker load -i /home/docker-images/gitlab-ce-17.0.1.tar # 加载 Docker 镜像 | ||
$ docker images # 验证镜像是否加载成功 | ||
``` | ||
|
||
### 通过容器创建镜像 | ||
|
||
我们可以通过以下两种方式对镜像进行更改。 | ||
|