Hi,
I am building a pipeline to build and distribute a dockerised application. I am able to get the container built and running but because it's essentially an open-ended container that runs and runs I need to ensure it is running and then stop the container and move to the next steps in the pipeline.
Is there any way to do this? The reason I want to ensure that it runs is I have experienced issues in the past where dependencies in parts of the Dockerfile stages were updated and caused the container to build but not run.
Currently, I have tried curl'ing the localhost but that doesn't get triggered. the container runs and as it's long-standing it therefore just stays on that command indefinitely.
Hey @obsydian
It's possible and mainly depends on your definition of "successful run" of your image. Does "successful" mean that the container run for X seconds? or reached a certain point in the code? something else?
Basically, you would need to:
Hope that helps
By runs I just need to check it doesn't error on running. I just need to check that the server is up and running and that could be done by checking the container log which shows the following.
[info] The server listening at port: 4000
Or by pinging the healthcheck endpoint. I'm not sure which is preferable or how I go about doing this as the next step in the pipeline. Any comments or leads welcome but thanks for your input already.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.