修订版 | b384e9dbbbf142d02be169e99a6bd1bbabb96111 (tree) |
---|---|
时间 | 2022-06-09 23:55:06 |
作者 | Erik <erikgronwal@user...> |
Commiter | Erik |
Regular updates
@@ -49,7 +49,7 @@ This command changes only the `composer.lock` file. | ||
49 | 49 | |
50 | 50 | | Command | Description | |
51 | 51 | | --- | --- | |
52 | -| `composer require vendor/package`. | Adds `package` from `vendor` to composer.json's `require` section and installs it | | |
52 | +| `composer require vendor/package` | Adds `package` from `vendor` to composer.json's `require` section and installs it | | |
53 | 53 | | --- | --- | |
54 | 54 | | `composer require vendor/package --dev` | Adds `package` from `vendor` to composer.json's `require-dev` section and installs it. | |
55 | 55 |
@@ -47,6 +47,20 @@ ADD file.xyz /file.xyz | ||
47 | 47 | COPY --chown=user:group host_file.xyz /path/container_file.xyz |
48 | 48 | ``` |
49 | 49 | |
50 | +### Run commands in strict shell | |
51 | + | |
52 | +```docker | |
53 | +ENV my_var | |
54 | +SHELL ["/bin/bash", "-euo", "pipefail", "-c"] | |
55 | + | |
56 | +# With strict mode: | |
57 | +RUN false # fails build like using && | |
58 | +RUN echo "$myvar" # will throw error due to typo | |
59 | +RUN true | false # will bail out of pipe | |
60 | +``` | |
61 | + | |
62 | +Using `shell` will turn on strict mode for shell commands. | |
63 | + | |
50 | 64 | ### Onbuild |
51 | 65 | |
52 | 66 | ```docker |