akhildevelops / devcontainer-features Goto Github PK
View Code? Open in Web Editor NEWdevcontainer features
License: MIT License
devcontainer features
License: MIT License
I just wanted to let you know that I've (only very briefly, without doing any further debugging) tried this feature out, for google/android-fhir#2481, and it seems to me that there is a file permission issue?
In google/android-fhir#2482 (here) I originally tried:
"features": {
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {}
This installed just fine, but when a Gradle Script tried to write to $ANDROID_HOME
, which with this is set to /opt/android
it failed, because that directory is owned by root
but the UID when running a GitHub Codespace Dev Container is vscode
.
./gradlew dokkaHtml
(...)
> Configure project :workflow:benchmark
Checking the license for package Android SDK Build-Tools 33.0.1 in /opt/android/licenses
License for package Android SDK Build-Tools 33.0.1 accepted.
Preparing "Install Android SDK Build-Tools 33.0.1 v.33.0.1".
Warning: Failed to read or create install properties file.
FAILURE: Build failed with an exception.
* Where:
Build file '/workspaces/android-fhir/workflow/benchmark/build.gradle.kts' line: 3
* What went wrong:
An exception occurred applying plugin request [id: 'androidx.benchmark']
> Failed to apply plugin 'androidx.benchmark'.
> Could not create task ':lockClocks'.
> Failed to install the following SDK components:
build-tools;33.0.1 Android SDK Build-Tools 33.0.1
The SDK directory is not writable (/opt/android)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 3m 11s
5 actionable tasks: 5 up-to-date
I was able to work-around this with sudo chown -R vscode:vscode /opt/android/
, but doing that probably shouldn't be required.
#16 [dev_containers_target_stage 6/13] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=pip_1,target=/tmp/build-features-src/pip_1 cp -ar /tmp/build-features-src/pip_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/pip_1 && cd /tmp/dev-container-features/pip_1 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/pip_1
2023-08-12 01:44:48.435Z: #16 0.464 ===========================================================================
2023-08-12 01:44:48.438Z: #16 0.464 Feature : Pip packages Download
#16 0.464 Description : Installs pip packages
#16 0.464 Id : ghcr.io/akhildevelops/devcontainer-features/pip
#16 0.464 Version : 0.0.1
#16 0.464 Documentation :
#16 0.464 Options :
#16 0.464 PACKAGES="pre-commit"
#16 0.464 ===========================================================================
#16 0.466 Installing APT Packages
#16 0.466 pre-commit
#16 0.466 pre-commit
#16 0.466 ./install.sh: line 13: pip: command not found
#16 0.467 ERROR: Feature "Pip packages Download" (ghcr.io/akhildevelops/devcontainer-features/pip) failed to install!
#16 ERROR: process "/bin/sh -c cp -ar /tmp/build-features-src/pip_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/pip_1 && cd /tmp/dev-container-features/pip_1 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/pip_1" did not complete successfully: exit code: 127
2023-08-12 01:44:48.441Z: ------
> [dev_containers_target_stage 6/13] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=pip_1,target=/tmp/build-features-src/pip_1 cp -ar /tmp/build-features-src/pip_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/pip_1 && cd /tmp/dev-container-features/pip_1 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/pip_1:
0.464 Version : 0.0.1
0.464 Documentation :
0.464 Options :
0.464 PACKAGES="pre-commit"
0.464 ===========================================================================
0.466 Installing APT Packages
0.466 pre-commit
0.466 pre-commit
0.466 ./install.sh: line 13: pip: command not found
0.467 ERROR: Feature "Pip packages Download" (ghcr.io/akhildevelops/devcontainer-features/pip) failed to install!
I've got:
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"installJupyterlab": true,
"version": "latest"
},
but it still fails.
@akhildevelops actually in order to be able to use #8 for #7 you would need to tag and release a v0.0.3 of this project to ghcr.io
, no?
In https://github.com/google/android-fhir/blob/c0414d2e3721eeccb1a9d476689dae457aa0b793/.devcontainer/devcontainer.json#L10 we're using:
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {},
and in the creation.log
(from Ctrl-P Codespaces: View Creation Log I'm still seeing:
#15 0.510 Feature : Android SDK Platform Tools
2024-07-12 12:41:09.042Z: #15 0.510 Description : Provides Android Tools
#15 0.510 Id : ghcr.io/akhildevelops/devcontainer-features/android-cli
2024-07-12 12:41:09.270Z: #15 0.510 Version : 0.0.2
and the chown
from my PR is (obviously) not running.
Would you be willing to release 0.0.3 ?
After merging PR #8, I started encountering permission errors in GitHub Codespaces. The issue seems to be related to changes introduced in this pull request.
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {
"PACKAGES": "platform-tools,platforms;android-33,build-tools;33.0.2,ndk-bundle,ndk;24.0.8215888,cmake;3.22.1"
}
#16 3.162 extracting: cmdline-tools/lib/README
2024-08-03 13:58:53.782Z: #16 3.225 chown: 2024-08-03 13:58:53.935Z: invalid user: 'vscode:vscode'
2024-08-03 13:58:53.935Z: #16 3.229 ERROR: Feature "Android SDK Platform Tools" (ghcr.io/akhildevelops/devcontainer-features/android-cli) failed to install!
2024-08-03 13:58:54.343Z: #16 ERROR: process "/bin/sh -c cp -ar /tmp/build-features-src/android-cli_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/android-cli_1 && cd /tmp/dev-container-features/android-cli_1 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/android-cli_1" did not complete successfully: exit code: 1
2024-08-03 13:58:54.544Z: ------
2024-08-03 13:58:54.544Z: > [dev_containers_target_stage 6/6] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=android-cli_1,target=/tmp/build-features-src/android-cli_1 cp -ar /tmp/build-features-src/android-cli_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/android-cli_1 && cd /tmp/dev-container-features/android-cli_1 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/android-cli_1:
2.636 extracting: cmdline-tools/lib/external/com/beust/jcommander/1.78/jcommander-1.78.jar
2.637 extracting: cmdline-tools/lib/external/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar
2.638 extracting: cmdline-tools/lib/lint/cli/cli.jar
2.642 extracting: cmdline-tools/lib/lint/tools.lint-api.jar
2.648 extracting: cmdline-tools/lib/lint/tools.lint-model.jar
2.650 extracting: cmdline-tools/lib/build-system/builder-model/builder-model.jar
2024-08-03 13:58:54.544Z: 2.651 extracting: cmdline-tools/lib/external/lint-psi/intellij-core/intellij-core-mvn.jar
2024-08-03 13:58:54.547Z:
2024-08-03 13:58:54.553Z: invalid user: 'vscode:vscode'
3.229 ERROR: Feature "Android SDK Platform Tools" (ghcr.io/akhildevelops/devcontainer-features/android-cli) failed to install!
------
2024-08-03 13:58:54.553Z: Dockerfile.extended:362024-08-03 13:58:54.553Z:
--------------------
2024-08-03 13:58:54.553Z: 35 | ENV ANDROID_HOME="/opt/android"
36 | >>> RUN --mount=type=bind,from=dev_containers_feature_content_source,source=android-cli_1,target=/tmp/build-features-src/android-cli_1 \
37 | >>> cp -ar /tmp/build-features-src/android-cli_1 /tmp/dev-container-features \2024-08-03 13:58:54.554Z:
38 | >>> && chmod -R 0755 /tmp/dev-container-features/android-cli_1 \
39 | >>> && cd /tmp/dev-container-features/android-cli_1 \
40 | >>> && chmod +x ./devcontainer-features-install.sh \
41 | >>> && ./devcontainer-features-install.sh \2024-08-03 13:58:54.556Z:
42 | >>> && rm -rf /tmp/dev-container-features/android-cli_1
43 |
--------------------
2024-08-03 13:58:54.557Z: ERROR: failed to solve: process "/bin/sh -c cp -ar /tmp/build-features-src/android-cli_1 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/android-cli_1 && cd /tmp/dev-container-features/android-cli_1 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/android-cli_1" did not complete successfully: exit code: 1
2024-08-03 13:58:54.558Z: {"outcome":"error","message":"Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.56.1-1722693527840 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:1-18 --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-red-mobile-backend-fa28a712154d1740b9ffc97d506283d5153bd11a91b3d996a8680ee06163dbf7-features -f /tmp/devcontainercli-root/container-features/0.56.1-1722693527840/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder","description":"An error occurred setting up the container."}
2024-08-03 13:58:54.559Z: Stop: Run: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.56.1-1722693527840 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:1-18 --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-red-mobile-backend-fa28a712154d1740b9ffc97d506283d5153bd11a91b3d996a8680ee06163dbf7-features -f /tmp/devcontainercli-root/container-features/0.56.1-1722693527840/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2024-08-03 13:58:54.568Z: Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.56.1-1722693527840 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:1-18 --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-red-mobile-backend-fa28a712154d1740b9ffc97d506283d5153bd11a91b3d996a8680ee06163dbf7-features -f /tmp/devcontainercli-root/container-features/0.56.1-1722693527840/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2024-08-03 13:58:54.569Z: at O$ (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:464:1253)
2024-08-03 13:58:54.571Z: at iK (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:464:997)
2024-08-03 13:58:54.571Z: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-08-03 13:58:54.571Z: at async gAA (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:481:3660)
2024-08-03 13:58:54.573Z: devcontainer process exited with exit code 1
2024-08-03 13:58:54.574Z: at async BC (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:481:4775)
2024-08-03 13:58:54.576Z: at async xeA (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:614:11265)
2024-08-03 13:58:54.577Z: at async UeA (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:614:11006)
====================================== ERROR ====================================
2024-08-03 13:58:54.590Z: Failed to create container.
=================================================================================
2024-08-03 13:58:54.591Z: Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.56.1-1722693527840 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:1-18 --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-red-mobile-backend-fa28a712154d1740b9ffc97d506283d5153bd11a91b3d996a8680ee06163dbf7-features -f /tmp/devcontainercli-root/container-features/0.56.1-1722693527840/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2024-08-03 13:58:54.597Z: Error code: 1302 (UnifiedContainersErrorFatalCreatingContainer)
====================================== ERROR ====================================
2024-08-03 13:58:54.612Z: Container creation failed.
=================================================================================
2024-08-03 13:58:54.636Z:
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.