Does anyone know if it’s possible to have commandb...
# docker
a
Does anyone know if it’s possible to have commandbox exit or break the docker build process when an error has occurred? It currently just keeps building.
b
How did you call box?
If you did it front a shell script, you need to set a bash flag to exit on error.
Copy code
#!/bin/bash
set -e

command that may error
a
I’m doing a single stage finalized build.
Copy code
Step 32/34 : RUN export FINALIZE_STARTUP=true;$BUILD_DIR/run.sh;unset FINALIZE_STARTUP
b
This is really just how bash works, nothing with docker
Where exactly is your error happening?
your screenshot above doesn't really show anything
If it's from inside a shell script, my fix above is what you need to do
If it's from inside a core shell script that's bundled with the actual Ortus docker container, then you'll need to raise a bug so Jon can put that fix in the core image
👍 1
@Aubrey C.
a
Yes, its coming from the core shell script
run.sh
. I have the issue corrected, I just would prefer to have the build exit on error. It was missing the .cfconfig file.
Copy code
---> 0365875d86dd
Step 32/35 : RUN cat $BUILD_DIR/run.sh
 ---> Running in 18b23fe7b123
#!/bin/bash
set -e

## Handle deprecated/changed environment variables
. $BUILD_DIR/util/compat-env.sh

# If we have a finalized startup script bypass all further evaluation and use it authoritatively
if [[ -f $BIN_DIR/startup-final.sh ]]; then

	. $BUILD_DIR/util/env-secrets-expand.sh
	if [[ $USER ]] && [[ $USER != $(whoami) ]]; then
		if [[ -f /etc/alpine-release ]]; then
			su -p -c $BIN_DIR/startup-final.sh $USER
		else
			su --preserve-environment -c $BIN_DIR/startup-final.sh $USER
		fi
	else
		$BIN_DIR/startup-final.sh
	fi

else
b
Enter a ticket please
Jon will need to add that flag to whatever specific shell script is actually running the box start
@Aubrey C.
a
Will do! Thanks @bdw429s