diff --git a/tools/dind/Dockerfile b/tools/dind/Dockerfile index 20aec520..f2302569 100644 --- a/tools/dind/Dockerfile +++ b/tools/dind/Dockerfile @@ -83,5 +83,6 @@ COPY config/services/ /etc/systemd/system/ COPY resin-vars vpn-init /usr/src/app/ RUN systemctl enable resin-supervisor-dind +RUN systemctl enable resin-supervisor-host-socket -CMD env > /etc/docker.env; exec /sbin/init \ No newline at end of file +CMD env > /etc/docker.env; exec /sbin/init diff --git a/tools/dind/config/services/resin-supervisor-host-socket.service b/tools/dind/config/services/resin-supervisor-host-socket.service new file mode 100644 index 00000000..b2b08f9a --- /dev/null +++ b/tools/dind/config/services/resin-supervisor-host-socket.service @@ -0,0 +1,17 @@ +[Unit] +Description=Host socket for resin supervisor +Requires=resin-supervisor.service +After=resin-supervisor.service + +[Service] +Restart=always +ExecStartPre=-/bin/rm -f /resin-data/resin-supervisor/host +ExecStart=/bin/bash -c ' \ + while true; do \ + rm -f /resin-data/resin-supervisor/host; \ + socat UNIX-LISTEN:/resin-data/resin-supervisor/host EXEC:/bin/bash,pty,setsid,setpgid,stderr,ctty; \ + done' +ExecStopPost=-/bin/rm -f /resin-data/resin-supervisor/host + +[Install] +WantedBy=multi-user.target