OSDN Git Service

Regular updates
authorErik <erikgronwal@users.osdn.me>
Thu, 9 Jun 2022 14:55:06 +0000 (23:55 +0900)
committerErik <erikgronwal@users.osdn.me>
Thu, 9 Jun 2022 14:55:06 +0000 (23:55 +0900)
composer.md
dockerfile.md

index 79abc2d..e73c3a3 100644 (file)
@@ -49,7 +49,7 @@ This command changes only the `composer.lock` file.
 
 | Command                          | Description                                                 |
 | ---                              | ---                                                         |
-| `composer require vendor/package`.      | Adds `package` from `vendor` to composer.json's `require` section and installs it             |
+| `composer require vendor/package`      | Adds `package` from `vendor` to composer.json's `require` section and installs it             |
 | ---                              | ---                                                         |
 | `composer require vendor/package --dev` | Adds `package` from `vendor` to composer.json's `require-dev` section and installs it.            |
 
index 62a0a94..83b02e8 100644 (file)
@@ -47,6 +47,20 @@ ADD file.xyz /file.xyz
 COPY --chown=user:group host_file.xyz /path/container_file.xyz
 ```
 
+### Run commands in strict shell
+
+```docker
+ENV my_var
+SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
+
+# With strict mode:
+RUN false # fails build like using &&
+RUN echo "$myvar" # will throw error due to typo
+RUN true | false # will bail out of pipe
+```
+
+Using `shell` will turn on strict mode for shell commands.
+
 ### Onbuild
 
 ```docker