This article is about CodeShip Pro.

Container is Slow to Exit after Completion of Command Step

You will need about one minute to read this article.

For steps that appear to hang for a bit of time after the step’s command has completed, consider investigating how the CMD and ENTRYPOINT instructions are provided to dependent containers.

At issue here is whether these instructions are provided in the ‘exec’ or ‘shell’ form (see Stack Overflow post for explanation of forms).

If a container’s instructions were provided in the shell form, a container may not exit gracefully upon completion of the step command and (as a result) would effectively hang until system timeouts take effect. Our recommendation is to use the exec form instead.

For an in depth discussion on why the shell form can be problematic, please check out this blog post. We’ve also prepared a demonstration of the differing behavior between shell and exec. You can git clone the repository and run it on your local machine via jet steps.

Need more help?

Contact our support team or post on Stack Overflow using the tag #codeship. Did you check the status page and changelog?

There are also several code examples and sample projects available for you to get started with.

Article not helpful?

Does this article need improvement? If so, please send feedback or submit a pull request!