-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.0.0 doc: Update README.md f703ba6
- Loading branch information
1 parent
63d990d
commit 8d500b2
Showing
5 changed files
with
30 additions
and
6 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 |
---|---|---|
|
@@ -293,6 +293,29 @@ <h2 id="镜像管理"><a aria-hidden="true" tabindex="-1" href="#镜像管理" c | |
# 连接进行进入命令行模式,exit命令退出。 | ||
docker run -t -i nginx:latest /bin/bash | ||
"><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre> | ||
<h2 id="下载镜像本地安装镜像"><a aria-hidden="true" tabindex="-1" href="#下载镜像本地安装镜像" class="anchor"><span class="icon icon-link"></span></a>下载镜像本地安装镜像</h2> | ||
<p>由于国区已经无法访问,可以将镜像打包,直接安装镜像压缩文件</p> | ||
<pre class="language-sh"><code class="language-sh code-highlight"><span class="code-line line-number" line="1">$ <span class="token function">docker</span> pull gitlab/gitlab-ce:17.0.1-ce.0 <span class="token comment"># 下载镜像</span> | ||
</span><span class="code-line line-number" line="2"><span class="token comment"># 保存 Docker 镜像到本地文件</span> | ||
</span><span class="code-line line-number" line="3">$ <span class="token function">docker</span> save <span class="token parameter variable">-o</span> <span class="token punctuation">[</span>output-file.tar<span class="token punctuation">]</span> <span class="token punctuation">[</span>image-name<span class="token punctuation">]</span> | ||
</span><span class="code-line line-number" line="4">$ <span class="token function">docker</span> save <span class="token parameter variable">-o</span> gitlab-ce-17.0.1.tar gitlab/gitlab-ce | ||
</span></code><input type="hidden" value="$ 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 | ||
"><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre> | ||
<p>将镜像文件发送到服务器</p> | ||
<pre class="language-sh"><code class="language-sh code-highlight"><span class="code-line line-number" line="1">$ <span class="token function">scp</span> <span class="token punctuation">[</span>output-file.tar<span class="token punctuation">]</span> <span class="token punctuation">[</span>user<span class="token punctuation">]</span>@<span class="token punctuation">[</span>server-ip<span class="token punctuation">]</span>:<span class="token punctuation">[</span>path<span class="token punctuation">]</span> | ||
</span><span class="code-line line-number" line="2">$ <span class="token function">scp</span> gitlab-ce-17.0.1.tar [email protected]:/home/docker-images | ||
</span></code><input type="hidden" value="$ scp [output-file.tar] [user]@[server-ip]:[path] | ||
$ scp gitlab-ce-17.0.1.tar [email protected]:/home/docker-images | ||
"><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre> | ||
<p>服务器上加载 Docker 镜像</p> | ||
<pre class="language-sh"><code class="language-sh code-highlight"><span class="code-line line-number" line="1">$ <span class="token function">docker</span> load <span class="token parameter variable">-i</span> /home/docker-images/gitlab-ce-17.0.1.tar <span class="token comment"># 加载 Docker 镜像</span> | ||
</span><span class="code-line line-number" line="2">$ <span class="token function">docker</span> images <span class="token comment"># 验证镜像是否加载成功</span> | ||
</span></code><input type="hidden" value="$ docker load -i /home/docker-images/gitlab-ce-17.0.1.tar # 加载 Docker 镜像 | ||
$ docker images # 验证镜像是否加载成功 | ||
"><div onclick="copied(this)" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre> | ||
<h3 id="通过容器创建镜像"><a aria-hidden="true" tabindex="-1" href="#通过容器创建镜像" class="anchor"><span class="icon icon-link"></span></a>通过容器创建镜像</h3> | ||
<p>我们可以通过以下两种方式对镜像进行更改。</p> | ||
|
@@ -972,7 +995,8 @@ <h2 id="license"><a aria-hidden="true" tabindex="-1" href="#license" class="anch | |
<li><a href="#旧版本安装" class="tocs-link">旧版本安装</a></li> | ||
<li><a href="#命令介绍" class="tocs-link">命令介绍</a></li> | ||
<li><a href="#服务管理" class="tocs-link">服务管理</a></li> | ||
<li><a href="#镜像管理" class="tocs-link">镜像管理</a> | ||
<li><a href="#镜像管理" class="tocs-link">镜像管理</a></li> | ||
<li><a href="#下载镜像本地安装镜像" class="tocs-link">下载镜像本地安装镜像</a> | ||
<ol class="tocs-list is-collapsed"> | ||
<li><a href="#通过容器创建镜像" class="tocs-link">通过容器创建镜像</a></li> | ||
<li><a href="#通过dockerfile创建镜像" class="tocs-link">通过Dockerfile创建镜像</a></li> | ||
|
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
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
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
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