[systemd-devel] Connect /usr/bin/init to docker container's STDOUT/STDIN

Kai Lueke kailueke at linux.microsoft.com
Fri Sep 30 12:39:31 UTC 2022


Hi,

On Thu, Sep 29, 2022 at 07:42:45PM +0200, Nicola Mori wrote:
> Hi,
> 3) Gitlab CI needs a shell running inside the container and attached to the
> container's STDIN/STDOUT

maybe it helps, when I did something similar the behavior of passing
"-it" to "docker run" or not could be unified by using this trick:
  CMD [ "/bin/sh", "-c", "if ! [ -e /dev/console ] ; then
  socat -u pty,link=/dev/console stdout & fi ; exec /sbin/init" ]
(In one line of the Dockerfile, you may need to use Entrypoint in your
case.)

Regards,
Kai


More information about the systemd-devel mailing list