Skip to content

Commit

Permalink
Modularized devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Apr 26, 2024
1 parent a5af979 commit a238be6
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .devcontainer/7z/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"id": "7z",
"version": "1.0.0",
"name": "7z",
"documentationURL": "",
"description": "7z"
}
10 changes: 10 additions & 0 deletions .devcontainer/7z/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive

echo "(*) Installing 7z"
apt-get update
apt-get install -y --no-install-recommends p7zip-full
apt-get clean -y
rm -rf /var/lib/apt/lists/*;

echo "Done!"
7 changes: 1 addition & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ FROM buildpack-deps:${VARIANT}-curl

USER root

# Install 7zip
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get upgrade -y \
&& apt-get -y install --no-install-recommends \
p7zip-full

ARG USERNAME=developer
ARG USER_UID=1000
ARG USER_GID=$USER_UID
Expand All @@ -19,6 +13,7 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
Expand Down
15 changes: 13 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,39 @@
//"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {
//
//},
"./upgrade": {

},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"./7z": {

},
"ghcr.io/devcontainers/features/node:1": {
"version": "18.17.1",
"nodeGypDependencies": "true"
},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
},
"./vortex": {

}
},
"overrideFeatureInstallOrder": [
//"ghcr.io/stuartleeks/dev-container-features/shell-history",
"./upgrade",
"ghcr.io/devcontainers/features/git",
"./7z",
"ghcr.io/devcontainers/features/node",
"ghcr.io/devcontainers/features/powershell"
"ghcr.io/devcontainers/features/powershell",
"./vortex"
],
"mounts": [
//"source=profile,target=/home/developer,type=volume",
//"target=/home/developer/.vscode-server,type=volume",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/AppData/Roaming/Vortex/plugins,target=/vortex-plugins,type=bind,consistency=default"
],
"postAttachCommand": "yarn install",
"customizations": {
Expand Down
7 changes: 7 additions & 0 deletions .devcontainer/upgrade/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"id": "upgrade",
"version": "1.0.0",
"name": "Upgrade",
"documentationURL": "",
"description": "Upgrade"
}
10 changes: 10 additions & 0 deletions .devcontainer/upgrade/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive

echo "(*) Upgrading"
apt-get update
apt-get upgrade -y
apt-get clean -y
rm -rf /var/lib/apt/lists/*;

echo "Done!"
14 changes: 14 additions & 0 deletions .devcontainer/vortex/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "vortex",
"version": "1.0.0",
"name": "Vortex",
"documentationURL": "",
"description": "Vortex",
"mounts": [
{
"source":"${localEnv:HOME}${localEnv:USERPROFILE}/AppData/Roaming/Vortex/plugins",
"target":"/vortex-plugins",
"type":"bind"
}
]
}

0 comments on commit a238be6

Please sign in to comment.