From 8fd836eec3268b143e974d070fcbda10f3aa39a2 Mon Sep 17 00:00:00 2001 From: iarg82 Date: Fri, 14 Feb 2025 00:55:54 +0500 Subject: [PATCH] Update devcontainer.json Added/Updated Docker configuration. Improved Zsh configuration. Fixed initialization bugs (if applicable). --- .devcontainer/devcontainer.json | 163 ++++++++++++-------------------- 1 file changed, 61 insertions(+), 102 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9a3b171..8e0dadd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,103 +1,62 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/debian { - "name": "Debian", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "docker.io/layerzerolabs/devcon:1.0.9", - - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": "true", - "configureZshAsDefaultShell": "true", - "installOhMyZsh": "true", - // username should be root and installOhMyZshConfig should be false to avoid overwriting .zshrc in the base image - "username": "root", - "installOhMyZshConfig": "false" - }, - "ghcr.io/devcontainers/features/docker-in-docker:2": { - // Docker Compose v2 is required for or compatible with the repository - "dockerDashComposeVersion": "v2", - // https://github.com/devcontainers/features/issues/573#issuecomment-1593854983 - "moby": false - } - }, - - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - // Theme - "PKief.material-icon-theme", - // git - "GitHub.remotehub", - "GitHub.copilot", - "GitHub.vscode-pull-request-github", - "eamodio.gitlens", - "vivaxy.vscode-conventional-commits", - // Editor - "oderwat.indent-rainbow", - "iliazeus.vscode-ansi", - "editorconfig.editorconfig", - // Spell checker - "streetsidesoftware.code-spell-checker", - // Zip - "arcanis.vscode-zipfs", - // PDF viewer - "tomoki1207.pdf", - // YAML - "redhat.vscode-yaml", - // Docker - "ms-azuretools.vscode-docker", - // Javascript and Typescript - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - // Solidity - "NomicFoundation.hardhat-solidity", - // Rust - "rust-lang.rust-analyzer", - // Move - "damirka.move-syntax", - "hashicorp.terraform", - // Live share - "ms-vsliveshare.vsliveshare", - // Mermaid - "bierner.markdown-mermaid" - ], - "settings": { - "remote.autoForwardPorts": false, - "terminal.integrated.defaultProfile.linux": "zsh", - "terminal.integrated.profiles.linux": { - "bash": { - "path": "/usr/bash" - }, - "zsh": { - "path": "/usr/bin/zsh" - } - } - } - } - }, - - "initializeCommand": { - "mkdir-aws": "mkdir -p ${localEnv:HOME}/.aws", - "touch-zsh-history": "touch ${localEnv:HOME}/.zsh_history" - }, - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "PLUGIN_PATH=~/.oh-my-zsh/custom/plugins/zsh-autosuggestions; if [ ! -d $PLUGIN_PATH ]; then git clone https://github.com/zsh-users/zsh-autosuggestions $PLUGIN_PATH; fi && sed -i'' -e 's/^plugins.*)/plugins=(git zsh-autosuggestions)/' ~/.zshrc", - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - "remoteUser": "root", - - "remoteEnv": { - "NPM_TOKEN": "${localEnv:NPM_TOKEN}", - "GH_TOKEN": "${localEnv:GH_TOKEN}", - "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}" - }, - - "mounts": [ - "source=${localEnv:HOME}/.aws,target=/root/.aws,type=bind", - "source=${localEnv:HOME}/.zsh_history,target=/root/.zsh_history,type=bind" - ] - } - \ No newline at end of file + "name": "Debian", + "image": "docker.io/layerzerolabs/devcon:1.0.9", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "configureZshAsDefaultShell": "true", + "installOhMyZsh": "true", + "username": "root", + "installOhMyZshConfig": "false" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "dockerDashComposeVersion": "v2", + "moby": false + } + }, + "customizations": { + "vscode": { + "extensions": [ + "PKief.material-icon-theme", + "GitHub.remotehub", + "GitHub.copilot", + "eamodio.gitlens", + "vivaxy.vscode-conventional-commits", + "oderwat.indent-rainbow", + "iliazeus.vscode-ansi", + "editorconfig.editorconfig", + "streetsidesoftware.code-spell-checker", + "redhat.vscode-yaml", + "ms-azuretools.vscode-docker", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "rust-lang.rust-analyzer", + "bierner.markdown-mermaid" + ], + "settings": { + "remote.autoForwardPorts": false, + "terminal.integrated.defaultProfile.linux": "zsh", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash" + }, + "zsh": { + "path": "/usr/bin/zsh" + } + } + } + } + }, + "initializeCommand": "mkdir -p ${localEnv:HOME}/.aws && touch ${localEnv:HOME}/.zsh_history", + "postCreateCommand": "PLUGIN_PATH=~/.oh-my-zsh/custom/plugins/zsh-autosuggestions; if [ ! -d $PLUGIN_PATH ]; then git clone https://github.com/zsh-users/zsh-autosuggestions $PLUGIN_PATH; fi && grep -q 'plugins=(git zsh-autosuggestions)' ~/.zshrc || sed -i'' -e 's/^plugins.*)/plugins=(git zsh-autosuggestions)/' ~/.zshrc", + "remoteUser": "root", + "remoteEnv": { + "NPM_TOKEN": "${localEnv:NPM_TOKEN}", + "GH_TOKEN": "${localEnv:GH_TOKEN}", + "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}" + }, + "mounts": [ + "source=${localEnv:HOME}/.aws,target=/root/.aws,type=bind", + "source=${localEnv:HOME}/.zsh_history,target=/root/.zsh_history,type=bind" + ] +}