TeamSpeak-Systems / teamspeak-linux-docker-images

docker build files for TeamSpeak servers
Other
114 stars 52 forks source link

Add support for custom entrypoint scripts #22

Closed scrummer closed 4 years ago

scrummer commented 5 years ago

Goal

It would be cool to mount custom entrypoint scripts into the container which are executed when the container is started.

Example

./custom-entrypoint.sh
echo 'Do some stuff here (inside container) before teamspeak is getting started'
./docker-compose.yml
version: '3'

services:
    teamspeak:
        image: teamspeak:latest
        # ...
        volumes:
            - ./custom-entrypoint.sh:/docker-entrypoint.d/custom-entrypoint.sh
        # ...

The current entrypoint-script then just runs every Shell-Script file inside /docker-entrypoint.d/.

Why?

We have the case that we need to modify stuff inside the container before TeamSpeak is started. This solution would be the easiest to prevent conflicts on updates.

Note: I can provide a PR as soon as I got the time for it. But shouldn't be a big thing.

muenchow commented 5 years ago

Thank you for the contribution, but i think i will have to reject it. The reason is that official images are supposed to show best practices, and i haven't found much use of /docker-entrypoint.d/ using a quick search. While the idea is interesting, i think we should be rather conservative what is included in this image.

I am sure you are aware you could achieve the same effect by inheriting from teamspeak using "FROM teamspeak", wrapping the entrypoint script, and then using the autobuild feature from docker hub.

scrummer commented 5 years ago

Yea, indeed. It's not quite "the standard". But what I can say: I've used this concept a few times and it's really helpful and works quite good.

So; Your decision to accept/reject it but, from my point of view, it would be great to have it :)

BR