features icon indicating copy to clipboard operation
features copied to clipboard

Unable to install java feacture Maven...pull access denied

Open dss010101 opened this issue 1 year ago • 1 comments

I have the following iin my devcontainer.json:

	"build": { "dockerfile": "Dockerfile" },

	"features": {
		"ghcr.io/devcontainers/features/java:1": {
			"version": "none",
			"installMaven": "true",
			"installGradle": "false"
		}
	},

My docker file looks like this:

FROM amazonlinux:2023
...
RUN dnf -y install java-1.8.0-amazon-corretto
...

The devcontainer build fails with the following:

2023-12-12T20:56:29.828Z] [+] Building 0.1s (4/4) FINISHED                                                
 => [internal] load build definition from Dockerfile-with-features         0.0s
 => => transferring dockerfile: 3.55kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => ERROR [internal] load metadata for docker.io/library/dev_container_fe  0.0s
 => CANCELED [internal] load metadata for docker.io/library/amazonlinux:2  0.0s
------
 > [internal] load metadata for docker.io/library/dev_container_feature_content_temp:latest:
------
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
[2023-12-12T20:56:29.832Z] Stop (267 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-devuser1/container-features/0.54.2-1702414589038/Dockerfile-with-features -t vsc-tss_dataservice-acd411462c8d26d73f4d516b44eff63a0078f3cd6ca4ec27677f33b0de3594ae --target dev_containers_target_stage --no-cache --pull --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=devuser1 --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/devuser1/projects/tss_dataservice/.devcontainer
[2023-12-12T20:56:30.083Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-devuser1/container-features/0.54.2-1702414589038/Dockerfile-with-features -t vsc-tss_dataservice-acd411462c8d26d73f4d516b44eff63a0078f3cd6ca4ec27677f33b0de3594ae --target dev_containers_target_stage --no-cache --pull --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=devuser1 --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/devuser1/projects/tss_dataservice/.devcontainer
[2023-12-12T20:56:30.083Z]     at Y$ (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:463:1860)
[2023-12-12T20:56:30.084Z]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2023-12-12T20:56:30.084Z]     at async Fw (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:462:1831)
[2023-12-12T20:56:30.084Z]     at async $J (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:462:608)
[2023-12-12T20:56:30.084Z]     at async tAA (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:479:3660)
[2023-12-12T20:56:30.084Z]     at async CC (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:479:4775)
[2023-12-12T20:56:30.084Z]     at async NeA (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:612:11107)
[2023-12-12T20:56:30.084Z]     at async MeA (/home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js:612:10848)
[2023-12-12T20:56:30.088Z] Stop (1251 ms): Run: /home/devuser1/.vscode-remote-containers/bin/02b90714767f05c734ac29a64d0e5b4768f532d8/node /home/devuser1/.vscode-remote-containers/dist/dev-containers-cli-0.328.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-648534a2-d4a6-43ca-bcb2-8598ac1deddc1702414584376 --workspace-folder /home/devuser1/projects/tss_dataservice --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/devuser1/projects/tss_dataservice --id-label devcontainer.config_file=/home/devuser1/projects/tss_dataservice/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/devuser1/projects/tss_dataservice/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root

Any ideas on how to solve this?

dss010101 avatar Dec 12 '23 21:12 dss010101

The documentation for the java feature you are trying to install states the following for os-support:

This Feature should work on recent versions of Debian/Ubuntu-based distributions with the apt package manager installed. bash is required to execute the install.sh script.

Looks like the base image amazonlinux:2023 that you are using on your Dockerfile does not come with apt (and it may not be a Debian/Ubuntu based image).

eljog avatar Dec 19 '23 17:12 eljog