j8r / dockerfiles

Repository for my dockerfiles
https://hub.docker.com/u/jrei
ISC License
123 stars 46 forks source link

How to run in Gitlab Runner #3

Closed mvorisek closed 5 years ago

mvorisek commented 5 years ago

How can jrei/systemd-debian:9 image be started in GitLab Runner enviroment, i.e. how to start it with only one command?

Entrypoint can be set to anything, but the container can not be manager, i.e. no daemon for the systemd can not started via the host docker as described in README https://github.com/j8r/dockerfiles/tree/master/systemd/debian.

exec /lib/systemd/systemd can be run without any issue, but how to open a bash then?

j8r commented 5 years ago

I am not familiar with GitLab runner, I've no answer to this question. systemd being the init system, it must be the first process to start to be the PID1.

mvorisek commented 5 years ago

Thanks, solved directly with systemd team.

j8r commented 5 years ago

I'm curious, what was the solution found @mvorisek ?

mvorisek commented 5 years ago

https://github.com/systemd/systemd/issues/12844#issuecomment-504683151 basically you start your command in default systemd service and then exit from it.

Before that I have also checked the --system switch, but they confirmed that this switch does allow the systemd to be run under different pid than 1. They have updated the docs based on that https://github.com/systemd/systemd/issues/12843#issuecomment-505160729