devcontainers / features

A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own
https://containers.dev/features
MIT License
851 stars 340 forks source link

docker-outside-of-docker feature wrongly update container entrypoint #954

Open cirolosapio opened 3 months ago

cirolosapio commented 3 months ago

in a dev container with compose.yml that use docker-outside-of docker feature it updates the main entrypoint which is not the expected result

with feature enabled

docker inspect --format='{{.Config.Entrypoint}}'  <container>
[
  [/bin/sh -c echo Container started
  trap "exit 0" 15
  /usr/local/share/docker-init.sh
  exec "$@"
  while sleep 1 & wait $!; do :; done - /usr/local/share/docker-init.sh
]

without feature enabled

docker inspect --format='{{.Config.Entrypoint}}'  <container>
[
  [/bin/sh -c echo Container started
  trap "exit 0" 15

  exec "$@"
  while sleep 1 & wait $!; do :; done - /usr/local/share/docker-init.sh
]

Solution use the postStartCommand instead

Additional info maybe #483 it's related

samruddhikhandale commented 3 months ago

Hi 👋

Historically, for initializing docker, we have intentionally used the main entrypoint for docker-in-docker and docker-outside-of-docker Features. Using the entrypoint has the perk of starting the initializing process in the background as well as this is the suggested approach by Moby.

Let's keep this issue open for more feedbacks from the community, thanks for bringing this up.