mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 16:37:34 +00:00
Refresh k8s docker versions and references
This commit is contained in:
@@ -193,7 +193,7 @@ RUN set -x ; cd /app \
|
||||
FROM composer as composer
|
||||
|
||||
COPY database/ /app/database/
|
||||
COPY composer.json /app/
|
||||
COPY composer.json composer.lock /app/
|
||||
|
||||
RUN set -x ; cd /app \
|
||||
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
|
||||
|
||||
@@ -84,7 +84,7 @@ RUN apt-get update && \
|
||||
|
||||
#### 3. 使用 `set -e` 和 `pipefail`
|
||||
|
||||
默认情况下,管道命令 `cmd1 | cmd2` 只要 `cmd2` 成功,整个 `RUN` 就视为成功。
|
||||
默认情况下,管道命令 `cmd1 | cmd2` 的返回值由最后一个命令 (`cmd2`) 决定,即使前面的命令失败了,整个 `RUN` 仍可能视为成功。
|
||||
|
||||
**❌ 隐蔽的错误**:
|
||||
|
||||
@@ -193,6 +193,6 @@ wget http://example.com/file.tar.gz
|
||||
EOF
|
||||
```
|
||||
|
||||
> 💡 使用 heredoc 需要在 Dockerfile 首行声明 BuildKit 语法版本:`# syntax=docker/dockerfile:1`
|
||||
> 使用 heredoc 需要在 Dockerfile 首行声明 BuildKit 语法版本:`# syntax=docker/dockerfile:1`
|
||||
|
||||
---
|
||||
|
||||
@@ -63,7 +63,9 @@ CMD echo $HOME
|
||||
|
||||
CMD ["sh", "-c", "echo $HOME"]
|
||||
```
|
||||
**优点**:可以使用环境变量、管道等 shell 特性 **缺点**:主进程是 sh,信号无法正确传递给应用
|
||||
**优点**:可以使用环境变量、管道等 shell 特性
|
||||
|
||||
**缺点**:主进程是 sh,信号无法正确传递给应用
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user