Skip to content

Instantly share code, notes, and snippets.

@danielduckworth
Created June 6, 2023 23:33
Show Gist options
  • Save danielduckworth/a73391470bb6da5b3f95de7635f01c8c to your computer and use it in GitHub Desktop.
Save danielduckworth/a73391470bb6da5b3f95de7635f01c8c to your computer and use it in GitHub Desktop.
Docker start up shell script
#!/bin/bash
# Write some commands here that will run on root user before startup.
# For example, to clone transformers and install it in dev mode:
# git clone https://github.com/huggingface/transformers.git
# cd transformers && pip install -e ".[dev]"
# on-my-zsh plugins
git clone https://github.com/zsh-users/zsh-autosuggestions \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zdharma/fast-syntax-highlighting.git \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
# VS Code Server
curl -fsSL https://aka.ms/install-vscode-server/setup.sh | sh
code-server --install-extension ms-python.python
code-server --install-extension ms-toolsai.jupyter
code-server --install-extension ms-python.vscode-pylance
code-server --install-extension ms-azuretools.vscode-docker
code-server --install-extension ms-vscode-remote.remote-containers
code-server --install-extension ms-vscode-remote.remote-ssh
code-server --install-extension ms-vscode-remote.remote-ssh-edit
code-server --install-extension ms-vscode-remote.remote-wsl
code-server --install-extension ms-vscode-remote.vscode-remote-extensionpack
# VS Code CLI with Tunnel Service
curl https://az764295.vo.msecnd.net/stable/b3e4e68a0bc097f0ae7907b217c1119af9e03435/vscode_cli_alpine_x64_cli.tar.gz | tar -zxvf -C /usr/local/bin
# Create a systemd service file for vs code tunnel
cat << EOF > /etc/systemd/system/code-tunnel.service
[Unit]
Description=VS Code Tunnel Service
[Service]
Type=simple
ExecStart=/usr/local/bin/code tunnel
User=$1
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
# Reload the systemd daemon
systemctl daemon-reload
# Enable the service to start on boot
systemctl enable code-tunnel.service
# Start the service immediately
systemctl start code-tunnel.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment