Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postStart exec breakOnError only fails when all containers have started #970

Open
jpraet opened this issue Mar 12, 2018 · 1 comment
Open

Comments

@jpraet
Copy link
Contributor

jpraet commented Mar 12, 2018

I have a build with multiple docker images, and have configured startParallel = false, so the containers start sequentially.

The first container (db2express) is configured with a postExec wait action, with breakOnError=true.

I notice because of delay in the logs that the postExec script of the first container is executed before the second container is started. This is as expected. However, when the postExec script fails, I would expect the build to fail immediately. Instead, it first starts the remaining containers, and only once they are all started am I seeing the error from the postExec script.

This is docker-maven-plugin 0.24.0 and docker 0.12.6 on Windows 7.

[INFO] DOCKER> [docker-stable.cbss.inet/cbsstools/db2express-c:latest] "db2express-openshift-poc-1.12": Start container d2e3dc52c8e2
[INFO] DOCKER> [rodolpheche/wiremock:2.1.11] "wiremock-openshift-poc-1.12": Start container 7b420510f7eb
[INFO] DOCKER> Pattern 'port' matched for container 7b420510f7eb
[INFO] DOCKER> [rodolpheche/wiremock:2.1.11] "wiremock-openshift-poc-1.12": Waited on log out 'port' 1708 ms
[INFO] DOCKER> [selenium/standalone-chrome:3.8.1] "selenium-openshift-poc-1.12": Start container 71c42c7d2368
[INFO] DOCKER> Pattern 'Selenium Server is up and running' matched for container 71c42c7d2368
[INFO] DOCKER> [selenium/standalone-chrome:3.8.1] "selenium-openshift-poc-1.12": Waited on log out 'Selenium Server is up and running' 3883 ms
[INFO] DOCKER> [docker-snapshots.cbss.inet/openshift-poc:1.12-dev-SNAPSHOT] "jboss-openshift-poc-1.12": Start container da71fdb63e18
[ERROR] DOCKER> Error occurred during container startup, shutting down...
[INFO] DOCKER> [docker-snapshots.cbss.inet/openshift-poc:1.12-dev-SNAPSHOT] "jboss-openshift-poc-1.12": Stop and removed container da71fdb63e18 after 0 ms
[INFO] DOCKER> [selenium/standalone-chrome:3.8.1] "selenium-openshift-poc-1.12": Stop and removed container 71c42c7d2368 after 0 ms
[INFO] DOCKER> [rodolpheche/wiremock:2.1.11] "wiremock-openshift-poc-1.12": Stop and removed container 7b420510f7eb after 0 ms
[INFO] DOCKER> [docker-stable.cbss.inet/cbsstools/db2express-c:latest] "db2express-openshift-poc-1.12": Stop and removed container d2e3dc52c8e2 after 0 ms
[ERROR] DOCKER> Executing '/bin/bash' with args '[-c, /init-database.sh]' inside container 'db2express-openshift-poc-1.12' [docker-stable.cbss.inet/cbsstools/db2express-c](d2e3dc52c8e2) resulted in a non-zero exit code: 4
@rhuss
Copy link
Collaborator

rhuss commented Mar 18, 2018

I agree with you that the plugin should 'fail fast'. Shouldn't be hard to fix hopefully. I hope to jump on to this asap, but you could accelerate this by submitting a PR ;-)

jpraet added a commit to kszbcss/docker-maven-plugin that referenced this issue Mar 18, 2018
Signed-off-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
jpraet added a commit to kszbcss/docker-maven-plugin that referenced this issue Mar 18, 2018
Signed-off-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
jpraet added a commit to kszbcss/docker-maven-plugin that referenced this issue Mar 18, 2018
Signed-off-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
jpraet added a commit to kszbcss/docker-maven-plugin that referenced this issue Mar 26, 2018
Signed-off-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
jpraet added a commit to kszbcss/docker-maven-plugin that referenced this issue Mar 26, 2018
Signed-off-by: Jimmy Praet <jimmy.praet@ksz-bcss.fgov.be>
rhuss added a commit that referenced this issue Apr 3, 2018
#970 postStart exec breakOnError should fail fast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants