From 0e4b938d0dbf2420f858e9ca0a84c5d8a16a4c97 Mon Sep 17 00:00:00 2001 From: Kohei Tokunaga Date: Tue, 27 Jun 2023 22:11:34 +0900 Subject: [PATCH] monitor: on-error: add docs for long form Signed-off-by: Kohei Tokunaga --- docs/guides/debugging.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/guides/debugging.md b/docs/guides/debugging.md index 08e68631..10262dd4 100644 --- a/docs/guides/debugging.md +++ b/docs/guides/debugging.md @@ -51,14 +51,19 @@ dev home media opt root sbin sys usr work Optional long form allows you specifying detailed configurations of the process. It must be CSV-styled comma-separated key-value pairs. -Supported keys are `args` (can be JSON array format), `entrypoint` (can be JSON array format), `env` (can be JSON array format), `user`, `cwd` and `tty` (bool). +Supported keys for configuring containers are `args` (can be JSON array format), `entrypoint` (can be JSON array format), `env` (can be JSON array format), `user`, `cwd` and `tty` (bool). +You can also specify `type=on-error` if you want to change the configuration of the container (e.g. commands to execute) that will be executed from the failed step. -Example: +Examples: ``` $ docker buildx build --invoke 'entrypoint=["sh"],"args=[""-c"", ""env | grep -e FOO -e AAA""]","env=[""FOO=bar"", ""AAA=bbb""]"' . ``` +``` +$ docker buildx build --invoke 'type=on-error,args=bash' . +``` + #### `on-error` If you want to start a debug session when a build fails, you can use @@ -85,6 +90,12 @@ Interactive container was restarted with process "edmzor60nrag7rh1mbi4o9lm8". Pr This allows you to explore the state of the image when the build failed. +You can also use long-form flag with `type=on-error` option. + +``` +$ docker buildx build --invoke 'type=on-error,args=bash' . +``` + #### `debug-shell` If you want to drop into a debug session without first starting the build, you