Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 95ae6e8

Browse files
authored
vscode-dev-containers dev container (#1334)
1 parent c0dcc9e commit 95ae6e8

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:latest
2+
3+
COPY fluxbox/* /tmp/fluxbox/
4+
COPY *.sh /tmp/scripts/
5+
RUN bash /tmp/scripts/install.sh \
6+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/scripts/ /tmp/fluxbox/

.devcontainer/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Dev Container for vscode-dev-containers
2+
3+
This folder includes a configuration for building dev containers or reviewing PRs inside of another dev container - "Inception" style 😎. It includes the Moby/Docker and a desktop with VS Code stable, insiders, and the Remote - Containers extension installed for quick testing of local scenarios when needed.
4+
5+
An web-based desktop viewer is automatically forwarded. The login password is `vscode`.
6+
7+
Run <kbd>F1</kbd> / <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> and select **Ports: Focus on Ports View** to see the address to use to connect to it.
8+
9+
However, most likely, this was not what you were looking for when you came to this repository. Actual dev container definitions can be found [under the `/containers` folder](https://github.com/microsoft/vscode-dev-containers/tree/main/containers) in this repository.

.devcontainer/devcontainer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"runArgs": [
6+
"--shm-size=1g",
7+
],
8+
"settings": {
9+
"resmon.show.battery": false,
10+
"resmon.show.cpufreq": false
11+
},
12+
"extensions": [
13+
"ms-azuretools.vscode-docker",
14+
"dbaeumer.vscode-eslint",
15+
"rogalmic.bash-debug",
16+
"mads-hartmann.bash-ide-vscode",
17+
"streetsidesoftware.code-spell-checker",
18+
"mutantdino.resourcemonitor",
19+
"bierner.github-markdown-preview",
20+
"EditorConfig.EditorConfig",
21+
"chrisdias.vscode-opennewinstance"
22+
],
23+
"forwardPorts": [6080],
24+
"portsAttributes": {
25+
"6080": {
26+
"label": "Desktop web client (noVNC)",
27+
"onAutoForward": "silent"
28+
},
29+
"5901": {
30+
"label": "VNC TCP port",
31+
"onAutoForward": "silent"
32+
},
33+
},
34+
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
35+
"remoteUser": "node",
36+
"features": {
37+
"docker-in-docker": "latest",
38+
"github-cli": "latest"
39+
},
40+
"overrideCommand": false,
41+
"hostRequirements": {
42+
"memory": "6gb"
43+
}
44+
}

.devcontainer/fluxbox/menu

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[begin] ( Application Menu )
2+
[exec] (File Manager) { nautilus ~ } <>
3+
[exec] (Text Editor) { mousepad } <>
4+
[exec] (VS Code) { /usr/bin/code } <>
5+
[exec] (VS Code Insiders) { /usr/bin/code-insiders } <>
6+
[exec] (Terminal) { tilix -w ~ -e /bin/bash -il } <>
7+
[exec] (Web Browser) { x-www-browser --disable-dev-shm-usage } <>
8+
[submenu] (System) {}
9+
[exec] (Set Resolution) { tilix -t "Set Resolution" -e bash /usr/local/bin/set-resolution } <>
10+
[exec] (Edit Application Menu) { mousepad ~/.fluxbox/menu } <>
11+
[exec] (Passwords and Keys) { seahorse } <>
12+
[exec] (Top Processes) { tilix -t "Top" -e htop } <>
13+
[exec] (Disk Utilization) { tilix -t "Disk Utilization" -e ncdu / } <>
14+
[exec] (Editres) {editres} <>
15+
[exec] (Xfontsel) {xfontsel} <>
16+
[exec] (Xkill) {xkill} <>
17+
[exec] (Xrefresh) {xrefresh} <>
18+
[end]
19+
[config] (Configuration)
20+
[workspaces] (Workspaces)
21+
[end]

.devcontainer/install.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -e
3+
export DEBIAN_FRONTEND=noninteractive
4+
5+
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
6+
7+
# Install VS Code for use in desktop if needed
8+
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
9+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list
10+
apt-get update
11+
apt-get -y install code code-insiders
12+
13+
# Setup Fluxbox menus
14+
mkdir -p /root/.fluxbox /home/node/.fluxbox
15+
cp -f /tmp/fluxbox/* /root/.fluxbox/
16+
cp -f /tmp/fluxbox/* /home/node/.fluxbox/
17+
chown -R node:node /home/node/.fluxbox
18+
19+
# Install firefox
20+
apt-get install -y firefox-esr

.devcontainer/postCreateCommand.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
install_extension() {
3+
/usr/bin/code --install-extension $1
4+
/usr/bin/code-insiders --install-extension $1
5+
}
6+
7+
# Install VS Code extensions into VS Code in desktop so we can try
8+
install_extension ms-vscode-remote.remote-containers
9+
install_extension ms-azuretools.vscode-docker
10+
install_extension streetsidesoftware.code-spell-checker
11+
install_extension chrisdias.vscode-opennewinstance
12+
install_extension mads-hartmann.bash-ide-vscode
13+
install_extension rogalmic.bash-debug

0 commit comments

Comments
 (0)