Skip to content

Instantly share code, notes, and snippets.

@TeroKeso
Last active January 22, 2024 05:36
Show Gist options
  • Save TeroKeso/c00c81ae93875b37267f11e371d4d92b to your computer and use it in GitHub Desktop.
Save TeroKeso/c00c81ae93875b37267f11e371d4d92b to your computer and use it in GitHub Desktop.
Code Remotetunnel

devcontainers

Version 1

sudo apt install npm
npm install -g @devcontainers/cli

Install

curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
tar -xf vscode_cli.tar.gz
sudo cp code /usr/local/bin/

Systemd

sudo nano /etc/systemd/system/code-service.service
[Unit]
Description=Code Tunnel
After=network.target

[Service]
Type=simple
Restart=always
User= student
ExecStart=/usr/local/bin/code tunnel --accept-server-license-terms

[Install]
WantedBy=multi-user.target

Start tunnels and verify

sudo service code-service start
sudo service code-service status
# --> To grant access to the server, please log into https://github.com/login/device and use code ABCD-AB12
sudo systemctl enable code-service
sudo reboot

Verify that all systems are working

sudo service code-service status
# --> To grant access to the server, please log into https://github.com/login/device and use code ABCD-AB12   #If needed#

Docker

sudo apt update && sudo apt upgrade -y

sudo apt install ca-certificates curl gnupg lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose -y

sudo usermod -aG docker $USER

sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment