Is there a way to configure containers to use the same dns resolution as the host?
you’ll need to install avahi with mdns in order to resolve .local domains from a container […]
By the way, if
server.local is some other device or machine on the local network, I think you would also need to configure host networking (
network_mode: host in the docker-compose.yml file). Not sure if the container would need to be privileged as well (privileged: true).
Now the container is stuck in “starting service …”.
CMD instruction does not seem to be called.
Try debugging what is actually being executed when the container starts. An ENTRYPOINT instruction is optional and interacts with a CMD instruction in certain ways. Check the documentation for both: CMD and ENTRYPOINT. Note that the ENTRYPOINT and CMD instructions of a base image will be “inherited”. If you need to override them and you would rather use just CMD to make things simpler, a trick is to set ENTRYPOINT to
'/usr/bin/env' as in this StackOverflow post.
Or can I somehow run both entrypoints?
Yes, in a way – by setting up your own entrypoint script (single entrypoint, say
'/usr/src/app/entry.sh') and editing your script so that it calls any other script you like (the other entrypoint, e.g.
'/usr/bin/entry.sh'). By the way, the entrypoint does not need to be a shell script: it can be any executable written in your chosen programming language.