mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-27 20:25:48 +00:00
Remove blank lines after code block markers
This commit is contained in:
@@ -27,7 +27,6 @@ $ docker run -it debian bash
|
||||
root@668e178d8d69:/# cat /etc/issue
|
||||
Debian GNU/Linux 8
|
||||
```
|
||||
|
||||
`Debian` 镜像很适合作为基础镜像,构建自定义镜像。
|
||||
|
||||
### 20.3.2 Ubuntu 系统简介
|
||||
@@ -62,7 +61,6 @@ HOME_URL="https://www.ubuntu.com/"
|
||||
SUPPORT_URL="https://help.ubuntu.com/"
|
||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
||||
```
|
||||
|
||||
当试图直接使用 `apt-get` 安装一个软件的时候,会提示 `E: Unable to locate package`。
|
||||
|
||||
```bash
|
||||
@@ -72,7 +70,6 @@ Building dependency tree... Done
|
||||
Reading state information... Done
|
||||
E: Unable to locate package curl
|
||||
```
|
||||
|
||||
这并非系统不支持 `apt-get` 命令。Docker 镜像在制作时为了精简清除了 `apt` 仓库信息,因此需要先执行 `apt-get update` 命令来更新仓库信息。更新信息后即可成功通过 `apt-get` 命令来安装软件。
|
||||
|
||||
```bash
|
||||
@@ -83,7 +80,6 @@ Get:2 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
|
||||
Fetched 25.8 MB in 8s (3215 kB/s)
|
||||
Reading package lists... Done
|
||||
```
|
||||
|
||||
首先,安装 `curl` 工具。
|
||||
|
||||
```bash
|
||||
@@ -98,7 +94,6 @@ The following additional packages will be installed:
|
||||
root@7d93de07bf76:/# curl
|
||||
curl: try 'curl --help' or 'curl --manual' for more information
|
||||
```
|
||||
|
||||
接下来,再安装 `apache` 服务。
|
||||
|
||||
```bash
|
||||
@@ -110,7 +105,6 @@ The following additional packages will be installed:
|
||||
apache2-bin apache2-data apache2-utils file libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libexpat1 libgdbm-compat4 libgdbm5 libicu60 liblua5.2-0 libmagic-mgc libmagic1 libperl5.26 libxml2 mime-support netbase perl perl-modules-5.26 ssl-cert xz-utils
|
||||
...
|
||||
```
|
||||
|
||||
启动这个 `apache` 服务,然后使用 `curl` 来测试本地访问。
|
||||
|
||||
```bash
|
||||
@@ -132,7 +126,6 @@ root@7d93de07bf76:/# curl 127.0.0.1
|
||||
<style type="text/css" media="screen">
|
||||
...
|
||||
```
|
||||
|
||||
配合使用 `-p` 参数对外映射服务端口,可以允许容器外来访问该服务。
|
||||
|
||||
### 20.3.3 相关资源
|
||||
|
||||
Reference in New Issue
Block a user