diff --git a/.github/workflows/tailscale-code.yml b/.github/workflows/tailscale-code.yml index a7dcf6a..e112d56 100644 --- a/.github/workflows/tailscale-code.yml +++ b/.github/workflows/tailscale-code.yml @@ -9,20 +9,17 @@ jobs: steps: - name: Run system container with `podman` run: | - podman run -d --name code --systemd=always --cap-add=NET_RAW --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --device=/dev/net/tun --device=/dev/fuse ghcr.io/gbraad-devenv/fedora/code:41 + podman run -d --name code --systemd=always --cap-add=NET_RAW --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --device=/dev/net/tun --device=/dev/fuse ghcr.io/gbraad-devenv/fedora/code-cli:41 - name: Tailscale setup (root) run: | - until podman exec code tailscale up --auth-key ${TAILSCALE_AUTHKEY} + until podman exec code tailscale up --auth-key ${TAILSCALE_AUTHKEY} --hostname code-${HOSTNAME} do sleep 0.1 done podman exec code tailscale set --ssh - podman exec code tailscale set --hostname code-${HOSTNAME} env: TAILSCALE_AUTHKEY: ${{ secrets.TAILSCALE_AUTHKEY}} - name: Hang around run: | - sleep 3 - podman exec -d code code serve-web --without-connection-token podman exec code tailscale serve --bg 8000 sleep infinity diff --git a/assets/code-serveweb@.service b/assets/code-serveweb@.service new file mode 100644 index 0000000..ec3d02f --- /dev/null +++ b/assets/code-serveweb@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Code Serve Web Service +After=network.target + +[Service] +ExecStart=/usr/bin/code serve-web --without-connection-token +Restart=always +User=%i + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/containers/Containerfile-code-cli b/containers/Containerfile-code-cli index c6ec62a..cdca03d 100644 --- a/containers/Containerfile-code-cli +++ b/containers/Containerfile-code-cli @@ -1,13 +1,18 @@ ARG BASE_VERSION="41" -FROM ghcr.io/gbraad-devenv/fedora/dotfiles:${BASE_VERSION} +FROM ghcr.io/gbraad-devenv/fedora/systemd:${BASE_VERSION} LABEL org.opencontainers.image.source = "https://github.com/gbraad-devenv/fedora" RUN cd /tmp \ && curl -fL https://code.visualstudio.com/sha/download?build=stable\&os=cli-alpine-x64 -o code-cli.tar.gz \ && tar zxvf code-cli.tar.gz \ - && mv code ~/.local/bin/ \ + && mv code /usr/bin/code \ && rm -f code-cli.tar.gz -ENTRYPOINT [ "/home/gbraad/.local/bin/code" ] +# systemd +COPY assets/code-serveweb@.service /etc/systemd/system/ + +RUN systemctl enable code-serveweb@root.service + +#ENTRYPOINT [ "/sbin/init" ]