Gitlab Docker Postfix start on "boot"

Viewed 776

I have set up GitLab on docker container (from gitlab/gitlab-ce). did apt-get install postfix inside container.

Now when I restart container, postfix is not started (through in /etc/rc2.d/ there is S01postfix link).

Question: how do I start services in container (like postfix) when docker container (re)starts?

1 Answers

You should re-build the container. Do you have the Dockerfile? if yes, you can modify it not only to add your service, you'll need to set an ENTRYPOINT to launch postfix while CMD passed as argument will launch gitlab.

But as somebody said in comments, this is a dirty solution. It should be separated containers.

Another "dirty" solution could be this: https://docs.docker.com/config/containers/multi-service_container/

Using the stuff of this last link (supervisord) you can use a wrapper to launch two ore more services inside the same container.

Related