devcontainers / feature-starter

A bootstrap repo for self-authoring Dev Container Features
https://containers.dev
MIT License
277 stars 132 forks source link

Fails running feature tests #32

Closed akhildevelops closed 1 year ago

akhildevelops commented 1 year ago

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
akhildevelops commented 1 year ago

I've seen similar problems with other people and they were also unable to create containers that are behind a proxy. In my case it could be due to docker running in docker that's unable to build the test containers properly.

As a workaround pull the image: docker.io/docker/dockerfile:1.4 and then run test suite i,e,

docker pull docker.io/docker/dockerfile:1.4
devcontainer features test .
joshspicer commented 1 year ago

Thanks for following up with your workaround. As an alternative data point, in the default codespaces image we use the docker-in-docker feature to run docker, and I generally have no issues running the test command.

Is there anything else unique about your dev environment at you may be able to share with us to root cause this?

akhildevelops commented 1 year ago

This problem was due to docker version after upgrading to v23.0.1 the issue got resolved. https://github.com/microsoft/vscode-remote-release/issues/7958#issuecomment-1425585936