devcontainers / features

A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own
https://containers.dev/features
MIT License
918 stars 371 forks source link

Container build fail while installing features/docker-in-docker:2 (SSL Certificate Issue) #1027

Closed namhyuck-kim-otsk closed 4 months ago

namhyuck-kim-otsk commented 4 months ago

Description

devcontainer build . --image-name devpod --workspace-folder

devcontainer.json

{
  "name": "Devcontainer",
  "build": {
    "dockerfile": "Dockerfile",
  },
 ...
  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:2": {}
  },
  "postCreateCommand": "bash ./.devcontainer/post-install.sh"
}

Error Log

(*) Installing docker-compose 2.28.1...
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

(!) Failed to fetch the latest artifacts for docker-compose v2.28.1...

Attempting to find latest version using GitHub Api.
compose_version=2.28.1

Attempting to install v2.28.1
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
ERROR: Feature "Docker (Docker-in-Docker)" (ghcr.io/devcontainers/features/docker-in-docker) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/docker-in-docker for help troubleshooting this error.
The command '/bin/sh -c chmod -R 0755 /tmp/dev-container-features/docker-in-docker_0 && cd /tmp/dev-container-features/docker-in-docker_0 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh' returned a non-zero code: 60
Error: Command failed: docker build -f /tmp/devcontainercli-xxx/container-features/0.65.0-1719896481019/Dockerfile-with-features -t devpod --target dev_containers_target_stage --add-host=***:*** --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/namhyuck/om-com-devpod/.devcontainer
    at mtA (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:466:1933)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Pm (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:465:1856)
    at async FrA (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:662:24692)
    at async yrA (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:662:22435)
{"outcome":"error","message":"Command failed: docker build -f /tmp/devcontainercli-namhyuck/container-features/0.65.0-1719896481019/Dockerfile-with-features -t devpod --target dev_containers_target_stage --add-host=***.com:*** --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/xxx/xxx/.devcontainer","description":"An error occurred building the image."}
namhyuck-kim-otsk commented 4 months ago

Good day,

It's found to be corporate network issue.

Building it outside the network works fine as expected.

Apologise for the trouble.