Comments (3)
I've been using this snippet of code in the devcontainer startup script to install VS Code extensions specified in devcontainer.json
. It's a pretty gross hack and you may well be able to come up with something better, but it might be useful as an example:
if ! which code-server > /dev/null; then
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
fi
CODE_CLI=code-server
if code -v > /dev/null; then
CODE_CLI=code
fi
mkdir -p ~/.vscode-server/extensions
set +e
extensions=( $(sed 's/\/\/.*$//g' */.devcontainer/devcontainer.json | jq -r -M '[.customizations.vscode.extensions[]?, .extensions[]?] | .[]' ) )
if [ "$${extensions[0]}" != "" ] && [ "$${extensions[0]}" != "null" ]; then
for extension in "$${extensions[@]}"; do
$CODE_CLI --extensions-dir ~/.vscode-server/extensions --install-extension "$extension"
done
fi
from envbuilder.
@geiseri if you have the VS Code Dev Containers extension do the customizations automatically install?
from envbuilder.
Ended up doing something very similar, would be nice to have this built in
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server --version 4.22.0
CODE_CLI=/tmp/code-server/bin/code-server
DEVCONTAINER_JSON=".devcontainer/devcontainer.json"
if [[ -f "$DEVCONTAINER_JSON" ]]; then
EXTENSIONS=$(sed '/^ *\/\//d' "$DEVCONTAINER_JSON" | jq -r '.customizations.vscode.extensions[]?')
if [[ -n "$EXTENSIONS" ]]; then
# Loop over each extension and install it
for EXTENSION in $EXTENSIONS; do
$CODE_CLI --install-extension $EXTENSION
done
fi
fi
$CODE_CLI --auth none --port 13337 >/tmp/code-server.log 2>&1 &
from envbuilder.
Related Issues (20)
- PoC: Modify envbuilder to support build resumption from any layer HOT 2
- PoC: Build a tool to validate file hashes against layer caches HOT 1
- feat: temporarily move rw mounts during image build
- enhancement: replace agentsdk.LogSender direct integration with external log sender HOT 1
- migrate to upstream kaniko HOT 4
- flake: Test_sendLogs
- Add `read-configuration` subcommand to output a merged devcontainer configuration HOT 1
- Allow generating/accessing a computed `devcontainer.json` inside an envbuilder workspace
- Provide a way for programs to know they're running inside a devcontainer/envbuilder workspace
- Embed the envbuilder binary in images HOT 6
- Sanitize the final container image for envbuilder
- Implement "repo-mode" to use the repo as source of truth for devcontainer/Dockerfile HOT 9
- Dev Containers: Support volume mounts of devcontainer spec HOT 2
- Dev Containers: Script init and Entrypoint
- Error running devcontainer with container registry kubernetes secret volume mounted HOT 2
- Add support for feature order definition in devcontainer definitions
- usability: fix ownership of Docker volume mounts to /home HOT 1
- coder/kaniko: support multi-stage builds with DoCacheProbe HOT 1
- devcontainer: support multi-stage build with dangling build stage
- devcontainer: support docker-compose
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envbuilder.