Skip to content

Commit

Permalink
Use code-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad authored Jan 8, 2025
1 parent 7504f43 commit e017159
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/tailscale-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions assets/[email protected]
Original file line number Diff line number Diff line change
@@ -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
11 changes: 8 additions & 3 deletions containers/Containerfile-code-cli
Original file line number Diff line number Diff line change
@@ -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/[email protected] /etc/systemd/system/

RUN systemctl enable [email protected]

#ENTRYPOINT [ "/sbin/init" ]

0 comments on commit e017159

Please sign in to comment.