-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customized the devcontainer
- Loading branch information
Showing
3 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian | ||
RUN apt-get update && apt-get install -y p7zip-full && rm -rf /var/lib/apt/lists/* | ||
# [Choice] Debian version (use bullseye on local arm64/Apple Silicon): bookworm, bullseye, buster | ||
ARG VARIANT="bookworm" | ||
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 | ||
|
||
# Create the user | ||
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 install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
USER $USERNAME | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,56 @@ | ||
{ | ||
"name": "NodeJS & Powershell & 7z", | ||
"dockerFile": "Dockerfile", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
"cacheFrom": "ghcr.io/BUTR/game-mount-and-blade2:latest" | ||
}, | ||
"features": { | ||
//"ghcr.io/stuartleeks/dev-container-features/shell-history:0": { | ||
// | ||
//}, | ||
"ghcr.io/devcontainers/features/git:1": { | ||
"version": "latest", | ||
"ppa": "false" | ||
}, | ||
"ghcr.io/devcontainers/features/node:1": { | ||
"version": "18.17.1", | ||
"nodeGypDependencies": "true" | ||
}, | ||
"ghcr.io/devcontainers/features/powershell:1": { | ||
"version": "latest" | ||
"version": "latest" | ||
} | ||
}, | ||
"overrideFeatureInstallOrder": [ | ||
//"ghcr.io/stuartleeks/dev-container-features/shell-history", | ||
"ghcr.io/devcontainers/features/git", | ||
"ghcr.io/devcontainers/features/node", | ||
"ghcr.io/devcontainers/features/powershell" | ||
], | ||
"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": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.powershell", | ||
"dbaeumer.vscode-eslint", | ||
"github.vscode-github-actions", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
], | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "pwsh", | ||
"terminal.integrated.profiles.linux": { | ||
"path": { | ||
"path": "/usr/local/bin/pwsh" | ||
} | ||
}, | ||
"powershell.powerShellAdditionalExePaths": { | ||
"pwsh": "/usr/local/bin/pwsh" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Dev Container Build and Push Image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: BUTR | ||
password: ${{ secrets.TOKEN_GPR }} | ||
- | ||
name: Pre-build dev container image | ||
uses: devcontainers/[email protected] | ||
with: | ||
subFolder: .github | ||
imageName: ghcr.io/devcontainer-${{ github.repository }} | ||
cacheFrom: ghcr.io/devcontainer-${{ github.repository }} | ||
push: always |