Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set up workspace devcontainer #7261

Closed
rzhao271 opened this issue Sep 27, 2022 · 2 comments
Closed

Unable to set up workspace devcontainer #7261

rzhao271 opened this issue Sep 27, 2022 · 2 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@rzhao271
Copy link

rzhao271 commented Sep 27, 2022

Testing #7248

When I try setting up the workspace devcontainer, I get the following error:

PS C:\Users\raymondzhao\work\endgame\devcontainer-metadata> devcontainer up --workspace-folder workspace --remove-existing-container
[32 ms] @devcontainers/cli 0.16.0. Node.js v16.9.1. win32 10.0.19043 x64.
[1413 ms] Start: Run: docker buildx build --load --build-arg _DEV_CONTAINERS_BASE_IMAGE=test-base-image --target dev_containers_target_stage -t vsc-workspace-bb054a2efce110fcf4f7e43a14da4cf2-features -f C:\Users\RAYMON~1\AppData\Local\Temp\devcontainercli\container-features\0.16.0-1664314882315\Dockerfile.extended C:\Users\RAYMON~1\AppData\Local\Temp\devcontainercli\empty-folder

[+] Building 12.6s (4/4) FINISHED
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load build definition from Dockerfile.extended              0.0s
 => => transferring dockerfile: 808B                                       0.0s
 => ERROR [internal] load metadata for docker.io/library/test-base-image  12.6s
 => [auth] library/test-base-image:pull token for registry-1.docker.io     0.0s
------
 > [internal] load metadata for docker.io/library/test-base-image:latest:
------
Dockerfile.extended:4
--------------------
   2 |     ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder
   3 |
   4 | >>> FROM $_DEV_CONTAINERS_BASE_IMAGE AS dev_containers_target_stage
   5 |     LABEL devcontainer.metadata="[ \
   6 |     {\"id\":\"terraform\",\"customizations\":{\"vscode\":{\"extensions\":
[\"HashiCorp.terraform\",\"ms-azuretools.vscode-azureterraform\"],\"settings\":{
\"terraform.languageServer.enable\":true,\"terraform.languageServer.args\":[\"se
rve\"],\"azureTerraform.terminal\":\"integrated\"}}}}, \
--------------------
error: failed to solve: test-base-image: pull access denied, repository does not
 exist or may require authorization: server message: insufficient_scope: authori
zation failed
Error: Command failed: docker buildx build --load --build-arg _DEV_CONTAINERS_BASE_IMAGE=test-base-image --target dev_containers_target_stage -t vsc-workspace-bb054a2efce110fcf4f7e43a14da4cf2-features -f C:\Users\RAYMON~1\AppData\Local\Temp\devcontainercli\container-features\0.16.0-1664314882315\Dockerfile.extended C:\Users\RAYMON~1\AppData\Local\Temp\devcontainercli\empty-folder
    at createSetupError (C:\Users\raymondzhao\AppData\Roaming\nvm\v16.9.1\node_modules\@devcontainers\cli\dist\spec-node\singleContainer.js:67:84)
    at openDockerfileDevContainer (C:\Users\raymondzhao\AppData\Roaming\nvm\v16.9.1\node_modules\@devcontainers\cli\dist\spec-node\singleContainer.js:62:15)
    at async resolveWithLocalFolder (C:\Users\raymondzhao\AppData\Roaming\nvm\v16.9.1\node_modules\@devcontainers\cli\dist\spec-node\configContainer.js:75:18)
    at async launch (C:\Users\raymondzhao\AppData\Roaming\nvm\v16.9.1\node_modules\@devcontainers\cli\dist\spec-node\devContainers.js:45:20)
    at async doProvision (C:\Users\raymondzhao\AppData\Roaming\nvm\v16.9.1\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:208:24)
    at async provision (C:\Users\raymondzhao\AppData\Roaming\nvm\v16.9.1\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:193:20)
{"outcome":"error","message":"Command failed: docker buildx build --load --build-arg _DEV_CONTAINERS_BASE_IMAGE=test-base-image --target dev_containers_target_stage -t vsc-workspace-bb054a2efce110fcf4f7e43a14da4cf2-features -f C:\\Users\\RAYMON~1\\AppData\\Local\\Temp\\devcontainercli\\container-features\\0.16.0-1664314882315\\Dockerfile.extended C:\\Users\\RAYMON~1\\AppData\\Local\\Temp\\devcontainercli\\empty-folder","description":"An error occurred setting up the container."}

Here are the test base image specs:

PS C:\Users\raymondzhao\work\endgame\devcontainer-metadata> docker inspect test-base-image
[
    {
        "Id": "sha256:8017d37f62ec1b2e97048e2fe2046cb883767a95affb709ff3f1b24611f1da9f",
        "RepoTags": [
            "test-base-image:latest",
            "vsc-base-15cca557df1f41fc9251b4a680207d90-features:latest"
        ],
        "RepoDigests": [],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2022-09-27T21:22:42.919069169Z",
        "Container": "",
        "ContainerConfig": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": null,
            "Cmd": null,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "root",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "bash"
            ],
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {
                "devcontainer.metadata": "[ {\"id\":\"terraform\",\"customizations\":{\"vscode\":{\"extensions\":[\"HashiCorp.terraform\",\"ms-azuretools.vscode-azureterraform\"],\"settings\":{\"terraform.languageServer.enable\":true,\"terraform.languageServer.args\":[\"serve\"],\"azureTerraform.terminal\":\"integrated\"}}}}, {\"postAttachCommand\":\"echo 'Hello from the postAttachCommand in the base image!'\",\"customizations\":{\"vscode\":{\"extensions\":[\"chrmarti.regex\"]}}} ]"
            }
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 309985805,
        "VirtualSize": 309985805,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/5df175894d32220c7b76e40d5620e81187dbf2f02efac7b208f442a568b3ddc9/diff:/var/lib/docker/overlay2/b68df17aee09ef83ceab2a9305437665a7d717c9ffd6f89e5ba1d88d215ac376/diff",
                "MergedDir": "/var/lib/docker/overlay2/5ac4f76a8d6e331b0dda211fe94ce73e5beafc114e435b23790ae83c33a96ba5/merged",
                "UpperDir": "/var/lib/docker/overlay2/5ac4f76a8d6e331b0dda211fe94ce73e5beafc114e435b23790ae83c33a96ba5/diff",
                "WorkDir": "/var/lib/docker/overlay2/5ac4f76a8d6e331b0dda211fe94ce73e5beafc114e435b23790ae83c33a96ba5/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:7f5cbd8cc787c8d628630756bcc7240e6c96b876c2882e6fc980a8b60cdfa274",
                "sha256:81ca3f697427fd89340d4ff5790e2df5ad3c332a5c95c5d9321ea88733080e4d",
                "sha256:1abf683949634b7ba15902710fdf4a9f06d63d1a4c07634f71f730c0824284bc"
            ]
        },
        "Metadata": {
            "LastTagTime": "2022-09-27T21:35:44.986487718Z"
        }
    }
]

I tried logging in to Docker Desktop, and using an admin terminal, but neither attempt worked.

@chrmarti
Copy link
Contributor

What do you get for docker buildx ls? (Could be you are using a builder that is isolated from the local image cache.)

What do you get for docker buildx version?

Does it work when you use test-base-image:latest in the workspace devcontainer.json?

This bug fix looks related: moby/moby#42951

Related: #6814

@chrmarti chrmarti added containers Issue in vscode-remote containers info-needed Issue requires more information from poster labels Sep 28, 2022
@rzhao271
Copy link
Author

I was using the wrong builder.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants