mirror of
https://github.com/yeasy/docker_practice.git
synced 2024-11-28 01:08:53 +00:00
delete all duplicate empty blanks
Signed-off-by: Xiang Dai <764524258@qq.com>
This commit is contained in:
parent
994f6ac101
commit
d4bbcc0cfb
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,20 +1,20 @@
|
|||||||
<!--
|
<!--
|
||||||
Thanks for your contribution.
|
Thanks for your contribution.
|
||||||
See [CONTRIBUTING](CONTRIBUTING.md) for contribution guidelines.
|
See [CONTRIBUTING](CONTRIBUTING.md) for contribution guidelines.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Proposed changes (Mandatory)
|
### Proposed changes (Mandatory)
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Tell us what you did and why:
|
Tell us what you did and why:
|
||||||
|
|
||||||
One line short description
|
One line short description
|
||||||
|
|
||||||
And details in other paragraphs.
|
And details in other paragraphs.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Fix issues (Optional)
|
### Fix issues (Optional)
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Tell us what issues you fixed, e.g., fix #123
|
Tell us what issues you fixed, e.g., fix #123
|
||||||
-->
|
-->
|
||||||
|
@ -67,7 +67,7 @@ services:
|
|||||||
dns: 114.114.114.114
|
dns: 114.114.114.114
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
drone-data:
|
drone-data:
|
||||||
```
|
```
|
||||||
|
|
||||||
替换 `${SSL_PATH}` 为你网站的 SSL 证书路径。
|
替换 `${SSL_PATH}` 为你网站的 SSL 证书路径。
|
||||||
@ -117,7 +117,7 @@ package main
|
|||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
fmt.Printf("Hello World!");
|
fmt.Printf("Hello World!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -13,7 +13,7 @@ UUID APP IMAGE NAME STATE CREATED STARTED NETWORKS
|
|||||||
57581644 etcd quay.io/coreos/etcd:v3.2.10 running 1 minute ago 1 minute ago
|
57581644 etcd quay.io/coreos/etcd:v3.2.10 running 1 minute ago 1 minute ago
|
||||||
```
|
```
|
||||||
|
|
||||||
`etcd` 使用方法请查看 [etcd 章节](../etcd/)。
|
`etcd` 使用方法请查看 [etcd 章节](../etcd/)。
|
||||||
|
|
||||||
## 容器管理
|
## 容器管理
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ $ docker run --rm -it \
|
|||||||
|
|
||||||
root@2affd44b4667:/# history
|
root@2affd44b4667:/# history
|
||||||
1 ls
|
1 ls
|
||||||
2 diskutil list
|
2 diskutil list
|
||||||
```
|
```
|
||||||
|
|
||||||
这样就可以记录在容器输入过的命令了。
|
这样就可以记录在容器输入过的命令了。
|
||||||
|
@ -14,7 +14,7 @@ services:
|
|||||||
- node1-data:/etcd-data
|
- node1-data:/etcd-data
|
||||||
expose:
|
expose:
|
||||||
- 2379
|
- 2379
|
||||||
- 2380
|
- 2380
|
||||||
networks:
|
networks:
|
||||||
cluster_net:
|
cluster_net:
|
||||||
ipv4_address: 172.16.238.100
|
ipv4_address: 172.16.238.100
|
||||||
|
@ -7,7 +7,7 @@ services:
|
|||||||
- node1-data:/etcd-data
|
- node1-data:/etcd-data
|
||||||
expose:
|
expose:
|
||||||
- 2379
|
- 2379
|
||||||
- 2380
|
- 2380
|
||||||
networks:
|
networks:
|
||||||
cluster_net:
|
cluster_net:
|
||||||
ipv4_address: 172.16.238.100
|
ipv4_address: 172.16.238.100
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
例如,编写 `app.go` 文件,该程序输出 `Hello World!`
|
例如,编写 `app.go` 文件,该程序输出 `Hello World!`
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
fmt.Printf("Hello World!");
|
fmt.Printf("Hello World!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -146,7 +146,7 @@ WORKDIR /root/
|
|||||||
|
|
||||||
COPY --from=0 /go/src/github.com/go/helloworld/app .
|
COPY --from=0 /go/src/github.com/go/helloworld/app .
|
||||||
|
|
||||||
CMD ["./app"]
|
CMD ["./app"]
|
||||||
```
|
```
|
||||||
|
|
||||||
构建镜像
|
构建镜像
|
||||||
|
@ -62,7 +62,7 @@ COPY webpack.mix.js /app/
|
|||||||
COPY resources/assets/ /app/resources/assets/
|
COPY resources/assets/ /app/resources/assets/
|
||||||
|
|
||||||
RUN cd /app \
|
RUN cd /app \
|
||||||
&& npm run production
|
&& npm run production
|
||||||
```
|
```
|
||||||
|
|
||||||
### 安装 Composer 依赖
|
### 安装 Composer 依赖
|
||||||
|
@ -48,7 +48,7 @@ $ sudo yum-config-manager \
|
|||||||
# 官方源
|
# 官方源
|
||||||
# $ sudo yum-config-manager \
|
# $ sudo yum-config-manager \
|
||||||
# --add-repo \
|
# --add-repo \
|
||||||
# https://download.docker.com/linux/centos/docker-ce.repo
|
# https://download.docker.com/linux/centos/docker-ce.repo
|
||||||
```
|
```
|
||||||
|
|
||||||
如果需要测试版本的 Docker CE 请使用以下命令:
|
如果需要测试版本的 Docker CE 请使用以下命令:
|
||||||
|
@ -83,7 +83,7 @@ $ sudo add-apt-repository \
|
|||||||
# $ sudo add-apt-repository \
|
# $ sudo add-apt-repository \
|
||||||
# "deb [arch=amd64] https://download.docker.com/linux/debian \
|
# "deb [arch=amd64] https://download.docker.com/linux/debian \
|
||||||
# $(lsb_release -cs) \
|
# $(lsb_release -cs) \
|
||||||
# stable"
|
# stable"
|
||||||
```
|
```
|
||||||
|
|
||||||
>以上命令会添加稳定版本的 Docker CE APT 源,如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly。
|
>以上命令会添加稳定版本的 Docker CE APT 源,如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly。
|
||||||
|
@ -55,7 +55,7 @@ $ sudo add-apt-repository \
|
|||||||
# $ sudo add-apt-repository \
|
# $ sudo add-apt-repository \
|
||||||
# "deb [arch=armhf] https://download.docker.com/linux/raspbian \
|
# "deb [arch=armhf] https://download.docker.com/linux/raspbian \
|
||||||
# $(lsb_release -cs) \
|
# $(lsb_release -cs) \
|
||||||
# stable"
|
# stable"
|
||||||
```
|
```
|
||||||
|
|
||||||
>以上命令会添加稳定版本的 Docker CE APT 源,如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly。
|
>以上命令会添加稳定版本的 Docker CE APT 源,如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly。
|
||||||
|
@ -81,7 +81,7 @@ $ sudo add-apt-repository \
|
|||||||
# $ sudo add-apt-repository \
|
# $ sudo add-apt-repository \
|
||||||
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
# "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||||
# $(lsb_release -cs) \
|
# $(lsb_release -cs) \
|
||||||
# stable"
|
# stable"
|
||||||
```
|
```
|
||||||
|
|
||||||
>以上命令会添加稳定版本的 Docker CE APT 镜像源,如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly。
|
>以上命令会添加稳定版本的 Docker CE APT 镜像源,如果需要测试或每日构建版本的 Docker CE 请将 stable 改为 test 或者 nightly。
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
使用 Docker 官方的 Registry 创建的仓库面临一些维护问题。比如某些镜像删除以后空间默认是不会回收的,需要一些命令去回收空间然后重启 Registry 程序。在企业中把内部的一些工具包放入 Nexus 中是比较常见的做法,最新版本 `Nexus3.x` 全面支持 Docker 的私有镜像。所以使用 [`Nexus3.x`](https://www.sonatype.com/download-oss-sonatype/) 一个软件来管理 `Docker` , `Maven` , `Yum` , `PyPI` 等是一个明智的选择。
|
使用 Docker 官方的 Registry 创建的仓库面临一些维护问题。比如某些镜像删除以后空间默认是不会回收的,需要一些命令去回收空间然后重启 Registry 程序。在企业中把内部的一些工具包放入 Nexus 中是比较常见的做法,最新版本 `Nexus3.x` 全面支持 Docker 的私有镜像。所以使用 [`Nexus3.x`](https://www.sonatype.com/download-oss-sonatype/) 一个软件来管理 `Docker` , `Maven` , `Yum` , `PyPI` 等是一个明智的选择。
|
||||||
|
|
||||||
### 启动 Nexus 容器
|
### 启动 Nexus 容器
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ docker run -d --name nexus3 --restart=always \
|
$ docker run -d --name nexus3 --restart=always \
|
||||||
@ -52,10 +52,10 @@ upstream register
|
|||||||
server {
|
server {
|
||||||
server_name YourDomainName;#如果没有 DNS 服务器做解析,请删除此选项使用本机 IP 地址访问
|
server_name YourDomainName;#如果没有 DNS 服务器做解析,请删除此选项使用本机 IP 地址访问
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
|
|
||||||
ssl_certificate key/example.crt;
|
ssl_certificate key/example.crt;
|
||||||
ssl_certificate_key key/example.key;
|
ssl_certificate_key key/example.key;
|
||||||
|
|
||||||
ssl_session_timeout 5m;
|
ssl_session_timeout 5m;
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
|
@ -46,7 +46,7 @@ docker@worker1:~$ docker swarm join \
|
|||||||
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
|
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
|
||||||
192.168.99.100:2377
|
192.168.99.100:2377
|
||||||
|
|
||||||
This node joined a swarm as a worker.
|
This node joined a swarm as a worker.
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -58,7 +58,7 @@ docker@worker1:~$ docker swarm join \
|
|||||||
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
|
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
|
||||||
192.168.99.100:2377
|
192.168.99.100:2377
|
||||||
|
|
||||||
This node joined a swarm as a worker.
|
This node joined a swarm as a worker.
|
||||||
```
|
```
|
||||||
|
|
||||||
>注意:一些细心的读者可能通过 `docker-machine create --help` 查看到 `--swarm*` 等一系列参数。该参数是用于旧的 `Docker Swarm`,与本章所讲的 `Swarm mode` 没有关系。
|
>注意:一些细心的读者可能通过 `docker-machine create --help` 查看到 `--swarm*` 等一系列参数。该参数是用于旧的 `Docker Swarm`,与本章所讲的 `Swarm mode` 没有关系。
|
||||||
|
Loading…
Reference in New Issue
Block a user