devcontainers / devcontainers/features
[docker-in-docker] - Use blocking entrypoints to ensure dockerd startup
- Dominant language
- Shell
- Stars
- 1.5k
- Forks
- 621
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 4
Description
We have seen flakiness in docker startups for `docker-in-docker` Feature where docker is not running in the container. See https://github.com/devcontainers/features/issues/634 and https://github.com/devcontainers/features/issues/660.
https://github.com/devcontainers/features/pull/669 adds few retry mechanisms to attempt to fix this issue.
`/usr/local/share/docker-init.sh` which starts/retries dockerd is added to the `entrypoint` property for the Feature. This command runs in the background and is not a blocking script for the container startup. Since it's in the background, `onCreateCommand/postCreateCommand/postStartCommand` could all start executing before docker is fully running. If it takes docker too long, that could introduce flakiness in those lifecycle scripts.
Opened https://github.com/devcontainers/spec/issues/299 which requests a new semantics to have "blocking" entrypoints that the CLI waits for. This way we can ensure that docker is already up and running for the mentioned ^ lifecycle scripts and is 💯 available in the container.
This issue tracks updates to dnd Feature, when blocking entrypoint is available.
Blocked by -
- https://github.com/devcontainers/spec/issues/299
Contributor guide
Assessment
This issue has not been assessed yet.