devcontainers / feature-starter Goto Github PK
View Code? Open in Web Editor NEWA bootstrap repo for self-authoring Dev Container Features
Home Page: https://containers.dev
License: MIT License
A bootstrap repo for self-authoring Dev Container Features
Home Page: https://containers.dev
License: MIT License
GitHub.amazon2561.com
Hello! Now that javascript-node v1 is released, I'm just wondering if you had plans to update the base image.
For about 99% of my use cases the current image is fine, but I just encountered an issue that required using a newer version of libc for one of my projects so I guess it'll be nice to update the libraries for everyone.
Naa
Upgrade the github workflows to use actions/checkout@v3
.
Right now actions/checkout@v2
is used and creates the following warnings.
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2
Whenever I try to run the test command in my devcontainer it fails and says dev-container-features-test-lib can't be found. How do I include that?
I'm trying to write a custom feature that installs Terraspace (see my repository here).
Terraspace runs on/with ruby and the installation process is pretty straightforward with gem. So to install it I would like to have my feature depend on ruby, meaning the ruby feature gets installed as well even if it is not mentioned in the original .devcontainer file. Is that possible?
If I define the feature dependency manually in a test everything works fine.
Wondering if we should update as follows to avoid duplication? ๐
"updateContentCommand": "npm install -g @devcontainers/cli"
Originally posted by @samruddhikhandale in #42 (comment)
Testing script with i.e. Alpine would fa il because missing bash, can you document how to install it before running the test?
node โ /workspaces/feature-starter (main) $ devcontainer features test --skip-scenarios -f color -i alpine:latest
Result:
OCI runtime exec failed: exec failed: unable to start container process: exec ./test.sh: no such file or directory: unknown
Mullvad/VPN
Originally posted by @Macyoutuber in oras-project/oras#987
Docker Version: Docker version 20.10.25, build v20.10.25
OS: NixOS 23
Steps:
devcontainer features test
Output:
devcontainer features test
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
| Dev Container Features |
โ v0.51.3 โ
โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
> baseImage: ubuntu:focal
> Target Folder: /home/s1n7ax/Workspace/ttt
> features: color, hello
> workspaceFolder: /tmp/devcontainercli/container-features-test/1696523352369
โณ Building test container...
[0 ms] @devcontainers/cli 0.51.3. Node.js v20.5.1. linux 6.1.44 x64.
[781 ms] Resolving Feature dependencies for './color'...
[2907 ms] Resolving Feature dependencies for './hello'...
[3645 ms] Soft-dependency 'ghcr.io/devcontainers/features/common-utils' is not required. Removing from installation order...
[3645 ms] Soft-dependency 'ghcr.io/devcontainers/features/common-utils' is not required. Removing from installation order...
[3650 ms] Start: Run: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696523353204 --build-arg _DEV_CONTAINERS_BASE_IMAGE=ubuntu:focal --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-1696523352369-033018f53a99096e4a22cae44aa8eed6cbf64b5c797b8676c14ce1669c67b8d4-features -f /tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696523353204/Dockerfile.extended /tmp/devcontainercli-s1n7ax/empty-folder
[+] Building 0.0s (0/0)
ERROR: http: invalid Host header
[-] Failed to launch container:
Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696523353204 --build-arg _DEV_CONTAINERS_BASE_IMAGE=ubuntu:focal --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-1696523352369-033018f53a99096e4a22cae44aa8eed6cbf64b5c797b8676c14ce1669c67b8d4-features -f /tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696523353204/Dockerfile.extended /tmp/devcontainercli-s1n7ax/empty-folder
Running the exact command directly throws this
docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696523353204 --build-arg _DEV_CONTAINERS_BASE_IMAGE=ubuntu:focal --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-1696523352369-033018f53a99096e4a22cae44aa8eed6cbf64b5c797b8676c14ce1669c67b8d4-features -f /tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696523353204/Dockerfile.extended /tmp/devcontainercli-s1n7ax/empty-folder
[+] Building 0.0s (0/0)
ERROR: http: invalid Host header
I get a similar error when building the devcontainer in vscode-remote-try-node
project
devcontainer build --workspace-folder .
[6 ms] @devcontainers/cli 0.51.3. Node.js v20.5.1. linux 6.1.44 x64.
[805 ms] Start: Run: docker buildx build --load --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:0-18-bullseye --target dev_containers_target_stage -t vsc-vscode-remote-try-node-706bf7468b84f151090b25e6199bc4b7f6e0dd6a51974ba52575e11a41d9c536-features -f /tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696524238759/Dockerfile.extended /tmp/devcontainercli-s1n7ax/empty-folder
[+] Building 0.0s (0/0)
ERROR: http: invalid Host header
{"outcome":"error","message":"Command failed: docker buildx build --load --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:0-18-bullseye --target dev_containers_target_stage -t vsc-vscode-remote-try-node-706bf7468b84f151090b25e6199bc4b7f6e0dd6a51974ba52575e11a41d9c536-features -f /tmp/devcontainercli-s1n7ax/container-features/0.51.3-1696524238759/Dockerfile.extended /tmp/devcontainercli-s1n7ax/empty-folder","description":"An error occurred building the container."}
However, in the same project, devcontainer up
works fine
devcontainer up --workspace-folder .
[2 ms] @devcontainers/cli 0.51.3. Node.js v20.5.1. linux 6.1.44 x64.
Sending build context to Docker daemon 2.607kB
Step 1/10 : ARG BASE_IMAGE
Step 2/10 : FROM $BASE_IMAGE
---> c5e428df0d17
Step 3/10 : USER root
---> Using cache
---> e74968de8636
Step 4/10 : ARG REMOTE_USER
---> Using cache
---> 70cb4a32a66b
Step 5/10 : ARG NEW_UID
---> Using cache
---> 0dfa4b818d9b
Step 6/10 : ARG NEW_GID
---> Using cache
---> c15edbe43129
Step 7/10 : SHELL ["/bin/sh", "-c"]
---> Using cache
---> 47d499e8c35a
Step 8/10 : RUN eval $(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd); eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd); eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group); if [ -z "$OLD_UID" ]; then echo "Remote user not found in /etc/passwd ($REMOTE_USER)."; elif [ "$OLD_UID" = "$NEW_UID" -a "$OLD_GID" = "$NEW_GID" ]; then echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID)."; elif [ "$OLD_UID" != "$NEW_UID" -a -n "$EXISTING_USER" ]; then echo "User with UID exists ($EXISTING_USER=$NEW_UID)."; else if [ "$OLD_GID" != "$NEW_GID" -a -n "$EXISTING_GROUP" ]; then echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID)."; NEW_GID="$OLD_GID"; fi; echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID."; sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd; if [ "$OLD_GID" != "$NEW_GID" ]; then sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group; fi; chown -R $NEW_UID:$NEW_GID $HOME_FOLDER; fi;
---> Using cache
---> 22419ce9f42b
Step 9/10 : ARG IMAGE_USER
---> Using cache
---> e9bc471825cf
Step 10/10 : USER $IMAGE_USER
---> Using cache
---> 0e942adabc96
Successfully built 0e942adabc96
Successfully tagged vsc-vscode-remote-try-node-706bf7468b84f151090b25e6199bc4b7f6e0dd6a51974ba52575e11a41d9c536-uid:latest
[232 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=/home/s1n7ax/Workspace/vscode-remote-try-node,target=/workspaces/vscode-remote-try-node -l devcontainer.local_folder=/home/s1n7ax/Workspace/vscode-remote-try-node -l devcontainer.config_file=/home/s1n7ax/Workspace/vscode-remote-try-node/.devcontainer/devcontainer.json --entrypoint /bin/sh -l devcontainer.metadata=[{"id":"ghcr.io/devcontainers/features/common-utils:2"},{"id":"ghcr.io/devcontainers/features/git:1"},{"id":"ghcr.io/devcontainers/features/node:1","customizations":{"vscode":{"extensions":["dbaeumer.vscode-eslint"]}}},{"customizations":{"vscode":{"extensions":["dbaeumer.vscode-eslint"]}},"remoteUser":"node"},{"postCreateCommand":"yarn install","customizations":{"vscode":{"settings":{},"extensions":["streetsidesoftware.code-spell-checker"]}},"portsAttributes":{"3000":{"label":"Hello Remote World","onAutoForward":"notify"}},"forwardPorts":[3000]}] vsc-vscode-remote-try-node-706bf7468b84f151090b25e6199bc4b7f6e0dd6a51974ba52575e11a41d9c536-uid -c echo Container started
Container started
Running the postCreateCommand from devcontainer.json...
yarn install v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.09s.
{"outcome":"success","containerId":"cceb422258443ea52b4b9971ab24f1bd6c7924288627c2bd28854388a2b1fe5a","remoteUser":"node","remoteWorkspaceFolder":"/workspaces/vscode-remote-try-node"}
Writing a feature that uses curl
is not exactly straight forward.
I copied some snippets from the aws-cli feature. However, a well documented example in this repository would be awesome.
Specifically, some documentation explaining why installing ca-certificates
manually is necessary. Forgetting to do so results in an error that is not so obvious.
Release Notes Persisted
Added the ability to send HTTP headers with
session.downloadURL()
.
Originally posted by @release-clerk in electron/electron#38870 (comment)
I tried to make a feature via this starter.
Blob /tmp/features-output-1699945273175/devcontainer-feature-.......tgz does not exist.
Via this comment devcontainers/features#752 (comment) it seems I should also have compiled something but I don't see those instructions in this feature-starter readme. So please can we make it clearer?
@linux-aarch64
Originally posted by @Macyoutuber in https://github.com/Macyoutuber/desktop-tutorial/issues/7
GitHub
E.g., https://github.com/devcontainers/features/blob/58e425039a1dc78cde64e9c1939e2a3dfed6d22a/.github/workflows/test-all.yaml for the two example features would be a nice addition for authors to start from.
The feature I have in mind depends on a secret which is provided when Codespaces is initialized. I have tried using entrypoint
, postStartCommand
and postAttachCommand
without success. I can see the agent is downloaded and can be initialized manually once Codespaces starts but what I'm looking for is to make it start automatically.
I think it would be useful to have the tests run on pushes to all branches, as that provides quicker feedback. Would then mean that anyone creating a new repo from this template repo would also have the tests run on all branches, out of the box. If the maintainers agree then I'm happy to submit a PR, thanks.
adding node is possible
"features": {
"ghcr.io/devcontainers/features/node:latest": {}
}
would be nice to have deno as well
Cannot run test suite of hello and color from a devcontainer created from devcontainer.json.
Received Error:
=> ERROR resolve image config for docker.io/docker/dockerfile:1.4 0.9s
------
> resolve image config for docker.io/docker/dockerfile:1.4:
------
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = error getting credentials - err: exit status 255, out: ``
[-] Failed to launch container:
Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-node/container-features/0.29.0-1675932924566 --build-arg _DEV_CONTAINERS_BASE_IMAGE=ubuntu:focal --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-1675932924443-2c0a8fb2f33fe2c0baa7b34dfd6cec19-features -f /tmp/devcontainercli-node/container-features/0.29.0-1675932924566/Dockerfile.extended /tmp/devcontainercli-node/empty-folder
GitHub.com
Originally posted by @Macyoutuber in Macyoutuber/Macyoutuber#1
While this repository is designed to implement a very simple set of Features, it would be great to demonstrate more functionality (like _REMOTE_USER
environment variable)
Git@runs
This default devcontainer template in this repo fails to load the devcontainer in VSCode on my M1 Macbook Pro. It seems to get into some kind of cycle where it knows that a devcontainer is available but it can't use it. The fix that I ran across on StackOverflow was to add an initializeCommand
to the devcontainer.json
file. This resolved the issue for me. Should this fix be incorporated into this template?
Fix
"initializeCommand": "echo 'Initializing devcontainer'",
goo
Macyoutuber
Hi, flowing Locally referenced Features instructions I get what seems to be a path parse error:
[3811 ms] * Processing feature: ./localFeatureA
[3811 ms] Local disk feature.
[3811 ms] Local file path parse error. Resolved path must be a child of the .devcontainer/ folder. Parsed: \e:\workspaces\ju.devcontainer\localFeatureA
[3812 ms] Error: Failed to process feature ./localFeatureA
devcontainer-feature.json is in e:\workspaces\ju\.devcontainer\localFeatureA
Error occurs when building with vscode on Windows 10. It builds In Linux.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.