amazon-linux-2023 icon indicating copy to clipboard operation
amazon-linux-2023 copied to clipboard

[Bug] - Errors during downloading metadata for repository 'amazonlinux'

Open TripathyJyotismita opened this issue 1 year ago • 17 comments

I am trying to deploy a lambda function using dockerfile. But before deploying the lambda i am trying to set up the env with required packages in a separate dockerfile. For this, i am using amazonlinux:2023 as base image. When i try to build the docker file on local it is failing on the following error:

docker build command i used: docker buildx build --platform linux/amd64 --security-opt seccomp=unconfined -t docker-image:test .

'' ERROR:

[+] Building 4.7s (7/28)                                                                                             docker:default
 => [internal] load build definition from dockerfile                                                                           0.0s
 => => transferring dockerfile: 2.93kB                                                                                         0.0s
 => [internal] load metadata for public.ecr.aws/amazonlinux/amazonlinux:latest                                                 1.5s
 => [internal] load .dockerignore                                                                                              0.0s
 => => transferring context: 2B                                                                                                0.0s
 => CANCELED [internal] load build context                                                                                     2.9s
 => => transferring context: 223.85MB                                                                                          2.8s
 => [ 1/24] FROM public.ecr.aws/amazonlinux/amazonlinux:latest@sha256:0fce1a3d077646b94ae788918642d6614f8bb57910958af34710367  0.0s
 => CACHED [ 2/24] RUN yum update -y                                                                                           0.0s
 => ERROR [ 3/24] RUN yum groupinstall -y "Development Tools"                                                                  2.9s
------                                                                                                                              
 > [ 3/24] RUN yum groupinstall -y "Development Tools":                                                                             
2.210 Amazon Linux 2023 repository                    0.0  B/s |   0  B     00:01                                                   
2.211 Errors during downloading metadata for repository 'amazonlinux':                                                              
2.211   - Curl error (60): SSL peer certificate or SSH remote key was not OK for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/x86_64/mirror.list [SSL certificate problem: unable to get local issuer certificate]                                   
2.211 Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (60): SSL peer certificate or SSH remote key was not OK for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/x86_64/mirror.list [SSL certificate problem: unable to get local issuer certificate]
2.211 Ignoring repositories: amazonlinux
2.260 Module or Group 'Development Tools' is not available.
2.268 Error: Nothing to do.
------
dockerfile:4
--------------------
   2 |     
   3 |     RUN yum update -y
   4 | >>> RUN yum groupinstall -y "Development Tools"
   5 |     RUN yum install -y wget llvm openssl-devel readline-devel zlib-devel vim jq shadow-utils git tar bind-utils hostname icu
   6 |     RUN yum install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel gcc-c++ make
--------------------
ERROR: failed to solve: process "/bin/sh -c yum groupinstall -y \"Development Tools\"" did not complete successfully: exit code: 1

'' The dockerfile looks below: ''

FROM public.ecr.aws/amazonlinux/amazonlinux:latest

RUN yum update -y
RUN yum groupinstall -y "Development Tools"
RUN yum install -y wget llvm openssl-devel readline-devel zlib-devel vim jq shadow-utils git tar bind-utils hostname icu
RUN yum install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel gcc-c++ make

# cdk and deps
RUN curl -sL https://rpm.nodesource.com/setup_20.x | bash -
RUN yum install nodejs -y
RUN npm install -g npm@latest aws-cdk@latest @aws-amplify/cli typescript@latest ts-node@latest jest@latest ts-jest@latest @types/node@latest @types/jest@latest @aws-cdk/cloud-assembly-schema@latest @aws-cdk/cx-api@latest @aws-cdk/region-info@latest constructs@latest @aws-cdk/core@latest @aws-cdk/assert@latest projen @aws-cdk/assert@latest

# Adding aws cli
RUN wget https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip
RUN unzip awscli-exe-linux-aarch64.zip
RUN ./aws/install

RUN curl -fsSL https://get.pnpm.io/install.sh | sh -

# Create and switch to agent user
RUN useradd -u 1001 -ms /bin/bash agent
WORKDIR /home/agent
USER agent

# Install pyenv and source
RUN curl -s https://pyenv.run | bash
ENV PATH=/home/agent/.pyenv/bin:/home/agent/.pyenv/shims:$PATH
# RUN echo export PATH="\$HOME/.pyenv:\$PATH" >> .profile

RUN pyenv install 3.12.4
RUN pyenv global 3.12.4
RUN pip install --upgrade pip setuptools wheel

# # # Install Poetry and source
RUN curl -sSL https://install.python-poetry.org | python -
ENV PATH="/home/agent/.local/bin:$PATH"

RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
COPY --chown=agent abc_aws_coonnectivity .

''

Docker version 26.1.4, build 5650f9b Running on WSL Ubuntu 22.4 TLS

TripathyJyotismita avatar Jul 08 '24 23:07 TripathyJyotismita

@TripathyJyotismita can you try running curl https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/x86_64/mirror.list and see if there are any errors. Use curl -v for more feedback. It's probably a transient connectivity issue.

It works from where I am:

zcobol@toto:~$ curl https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/x86_64/mirror.list
https://cdn.amazonlinux.com/al2023/core/guids/fc0995d528eeb98976ef3aedfd2f163c2fc55b562f9311855287ceb179a30f71/x86_64/

And output of docker build command:

zcobol@toto:~/amazon$ docker buildx build --platform linux/amd64 --security-opt seccomp=unconfined -t docker-image:test .
WARNING: security-opt flag is deprecated. "RUN --security=insecure" should be used with BuildKit.
[+] Building 192.0s (23/23) FINISHED                                                                                       docker:default
 => [internal] load build definition from Dockerfile                                                                                 0.0s
 => => transferring dockerfile: 1.72kB                                                                                               0.0s
 => [internal] load metadata for public.ecr.aws/amazonlinux/amazonlinux:latest                                                       0.5s
 => [internal] load .dockerignore                                                                                                    0.0s
 => => transferring context: 2B                                                                                                      0.0s
 => [ 1/19] FROM public.ecr.aws/amazonlinux/amazonlinux:latest@sha256:0fce1a3d077646b94ae788918642d6614f8bb57910958af34710367105c5c  4.2s
 => => resolve public.ecr.aws/amazonlinux/amazonlinux:latest@sha256:0fce1a3d077646b94ae788918642d6614f8bb57910958af34710367105c5c2a  0.0s
 => => sha256:0fce1a3d077646b94ae788918642d6614f8bb57910958af34710367105c5c2ad 770B / 770B                                           0.0s
 => => sha256:150255bb1fc9d734e3a4ffdd2a1ca52d57ff6e6f20023e5952cee7c8536b3ed5 528B / 528B                                           0.0s
 => => sha256:d511099bc09639cfee9a3b1d7e95afc6d4663cc2747d8493a52ef6fd3113a212 662B / 662B                                           0.0s
 => => sha256:e7e397c1ec124722f04233a73b0d76c315a91fa888de8c34df3b874e8461b2f7 52.32MB / 52.32MB                                     1.0s
 => => extracting sha256:e7e397c1ec124722f04233a73b0d76c315a91fa888de8c34df3b874e8461b2f7                                            3.0s
 => [ 2/19] RUN yum update -y                                                                                                        6.2s
 => [ 3/19] RUN yum groupinstall -y "Development Tools"                                                                             30.5s
 => [ 4/19] RUN yum install -y wget llvm openssl-devel readline-devel zlib-devel vim jq shadow-utils git tar bind-utils hostname ic  9.8s
 => [ 5/19] RUN yum install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-de  2.6s
 => [ 6/19] RUN curl -sL https://rpm.nodesource.com/setup_20.x | bash -                                                              1.4s
 => [ 7/19] RUN yum install nodejs -y                                                                                                3.3s
 => [ 8/19] RUN npm install -g npm@latest aws-cdk@latest @aws-amplify/cli typescript@latest ts-node@latest jest@latest ts-jest@lat  37.0s
 => [ 9/19] RUN wget https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip                                                       1.6s
 => [10/19] RUN unzip awscli-exe-linux-aarch64.zip                                                                                   3.2s
 => [11/19] RUN ./aws/install                                                                                                        1.7s
 => [12/19] RUN curl -fsSL https://get.pnpm.io/install.sh | sh -                                                                     3.2s
 => [13/19] RUN useradd -u 1001 -ms /bin/bash agent                                                                                  0.5s
 => [14/19] WORKDIR /home/agent                                                                                                      0.0s
 => [15/19] RUN curl -s https://pyenv.run | bash                                                                                     2.8s
 => [16/19] RUN pyenv install 3.12.4                                                                                                61.5s
 => [17/19] RUN pyenv global 3.12.4                                                                                                  0.4s
 => [18/19] RUN pip install --upgrade pip setuptools wheel                                                                           3.9s
 => [19/19] RUN curl -sSL https://install.python-poetry.org | python -                                                              13.6s
 => exporting to image                                                                                                               4.0s
 => => exporting layers                                                                                                              3.9s
 => => writing image sha256:34de8b0324f7ecc51c46c0107ffbba4b308000913c6ba3812ba6b37d9ae23455                                         0.0s
 => => naming to docker.io/library/docker-image:test                                                                                 0.0s

zcobol avatar Jul 09 '24 05:07 zcobol

Hello,

I have curl version: 7.81.0

`curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.17
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd`

Here is what i get from the above commands you shared:

`curl https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/x86_64/mirror.list
https://cdn.amazonlinux.com/al2023/core/guids/fc0995d528eeb98976ef3aedfd2f163c2fc55b562f9311855287ceb179a30f71/x86_64`

And build output:

`docker buildx build --platform linux/amd64 --security-opt seccomp=unconfined -t docker-image:test .
WARNING: security-opt flag is deprecated. "RUN --security=insecure" should be used with BuildKit.
[+] Building 2.0s (10/31)                                                                                                   docker:default
 => [internal] load build definition from dockerfile                                                                                  0.0s
 => => transferring dockerfile: 3.60kB                                                                                                0.0s
 => [internal] load metadata for public.ecr.aws/amazonlinux/amazonlinux:2023                                                          0.0s
 => [internal] load .dockerignore                                                                                                     0.0s
 => => transferring context: 2B                                                                                                       0.0s
 => [ 1/27] FROM public.ecr.aws/amazonlinux/amazonlinux:2023                                                                          0.0s
 => CANCELED [internal] load build context                                                                                            1.8s
 => => transferring context: 151.02MB                                                                                                 1.8s
 => CACHED [ 2/27] RUN yum update -y                                                                                                  0.0s
 => CACHED [ 3/27] RUN yum update -y ca-certificates                                                                                  0.0s
 => CACHED [ 4/27] RUN curl -k -o /etc/yum.repos.d/amazonlinux.repo https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/  0.0s
 => CACHED [ 5/27] RUN echo -e "[customrepo]\nname=Custom Repository\nbaseurl=https://cdn.amazonlinux.com/al2/latest/repos/2/latest/  0.0s
 => ERROR [ 6/27] RUN yum makecache &&     yum groupinstall -y "Development Tools"                                                    1.8s
------                                                                                                                                     
 > [ 6/27] RUN yum makecache &&     yum groupinstall -y "Development Tools":                                                               
1.146 Warning: failed loading '/etc/yum.repos.d/amazonlinux.repo', skipping.                                                               
1.148 There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".                                  
1.380 Warning: failed loading '/etc/yum.repos.d/amazonlinux.repo', skipping.
1.399 Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".
------
dockerfile:12
--------------------
  11 |     # Update Yum repositories and install Development Tools
  12 | >>> RUN yum makecache && \
  13 | >>>     yum groupinstall -y "Development Tools"
  14 |     RUN yum install -y wget llvm openssl-devel readline-devel zlib-devel vim jq shadow-utils git tar bind-utils hostname icu
--------------------
ERROR: failed to solve: process "/bin/sh -c yum makecache &&     yum groupinstall -y \"Development Tools\"" did not complete successfully: exit code: 1`

I am getting the error on both, with VPN or without VPN.

TripathyJyotismita avatar Jul 09 '24 07:07 TripathyJyotismita

Are you still seeing any similar issues?

stewartsmith avatar Sep 26 '24 18:09 stewartsmith

Hi, I am also getting the same error. My docker version is 4.28.0, Ubuntu 22.04.3 LTS. My curl version is curl 7.81.0

getting error when executed below commands.

$ docker run --security-opt seccomp=unconfined -it public.ecr.aws/amazonlinux/amazonlinux:2023 bash-5.2# dnf update Amazon Linux 2023 repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'amazonlinux':

  • Curl error (28): Timeout was reached for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list [Failed to connect to cdn.amazonlinux.com port 443 after 30001 ms: Timeout was reached]
  • Curl error (28): Timeout was reached for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list [Connection timeout after 30000 ms]
  • Curl error (28): Timeout was reached for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list [Connection timeout after 30001 ms]
  • Curl error (28): Timeout was reached for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list [Failed to connect to cdn.amazonlinux.com port 443 after 30002 ms: Timeout was reached]
  • Curl error (28): Timeout was reached for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list [Failed to connect to cdn.amazonlinux.com port 443 after 30000 ms: Timeout was reached] Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list [Failed to connect to cdn.amazonlinux.com port 443 after 30000 ms: Timeout was reached] Ignoring repositories: amazonlinux Dependencies resolved. Nothing to do. Complete! bash-5.2# exit

skc1111 avatar Oct 11 '24 05:10 skc1111

The actual build error, I am getting during execution of make build.

258.9 - Curl error (7): Couldn't connect to server for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240916/x86_64/mirror.list [Failed to connect to proxy.ccc-ng-1.eu-west-1.aws.cloud.bmw port 8080 after 21665 ms: Couldn't connect to server] 258.9 Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (7): Couldn't connect to server for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240916/x86_64/mirror.list [Failed to connect to proxy.ccc-ng-1.eu-west-1.aws.cloud.bmw port 8080 after 21665 ms: Couldn't connect to server]

skc1111 avatar Oct 11 '24 05:10 skc1111

@stewartsmith Could you please look at the above issue and share your insights.

skc1111 avatar Oct 12 '24 00:10 skc1111

Forwarded internally... it works for me but I'm in Australia...

ozbenh avatar Oct 13 '24 00:10 ozbenh

Hello,

I tried to reproduce issue from an EC2 instance in eu-west-1 but everything worked for me:

$ TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 3600")
$ curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/region
eu-west-1
$ sudo docker run --security-opt seccomp=unconfined -it public.ecr.aws/amazonlinux/amazonlinux:2023
Unable to find image 'public.ecr.aws/amazonlinux/amazonlinux:2023' locally
2023: Pulling from amazonlinux/amazonlinux
5acaf245b957: Pull complete
Digest: sha256:d98c1c8b83f153add6073e6579d153398928f2d5117d982f3cb0d03e8cb09f53
Status: Downloaded newer image for public.ecr.aws/amazonlinux/amazonlinux:2023
bash-5.2# dnf update -y
Amazon Linux 2023 repository                                                                                                                                                           39 MB/s |  28 MB     00:00
Last metadata expiration check: 0:00:04 ago on Sun Oct 13 01:27:06 2024.
Dependencies resolved.
Nothing to do.
Complete!
bash-5.2# dnf repolist -v
DNF version: 4.14.0
cachedir: /var/cache/dnf
Last metadata expiration check: 0:00:08 ago on Sun Oct 13 01:27:06 2024.
Repo-id            : amazonlinux
Repo-name          : Amazon Linux 2023 repository
Repo-revision      : 1727827200
Repo-updated       : Wed Oct  2 00:00:00 2024
Repo-pkgs          : 20503
Repo-available-pkgs: 20503
Repo-size          : 65 G
Repo-mirrors       : https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list
Repo-baseurl       : https://cdn.amazonlinux.com/al2023/core/guids/ec65be5c079f54c6ca12835c0c894a6dc6f6eab4afdc4d57df783bfae1ccecac/x86_64/ (0 more)
Repo-expire        : 172800 second(s) (last: Sun Oct 13 01:27:06 2024)
Repo-filename      : /etc/yum.repos.d/amazonlinux.repo
Total packages: 20503
ash-5.2# curl --version
curl 8.5.0 (x86_64-amazon-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.8 zlib/1.2.11 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.2) nghttp2/1.59.0
Release-Date: 2023-12-06
Protocols: file ftp ftps http https
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz PSL SPNEGO SSL threadsafe UnixSockets
bash-5.2# curl https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20241001/x86_64/mirror.list
https://cdn.amazonlinux.com/al2023/core/guids/ec65be5c079f54c6ca12835c0c894a6dc6f6eab4afdc4d57df783bfae1ccecac/x86_64/

Also tried older releases:

bash-5.2# curl https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240701/x86_64/mirror.list
https://cdn.amazonlinux.com/al2023/core/guids/fc0995d528eeb98976ef3aedfd2f163c2fc55b562f9311855287ceb179a30f71/x86_64/bash-5.2#
bash-5.2#
bash-5.2# curl https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240916/x86_64/mirror.list
https://cdn.amazonlinux.com/al2023/core/guids/d5db1113b620ab2be818304dac5d0f1618098c19a373717a0470d7640ae82984/x86_64/bash-5.2#
bash-5.2#

Could you please share details of your setup ?

sktomer avatar Oct 13 '24 01:10 sktomer

My docker version is 4.28.0, Ubuntu 22.04.3 LTS. My curl version is curl 7.81.0.

Sometimes, I am also getting this error.

main "$@" Line 101: main Line 26: local goal=job Line 31: export DOCKER_HOST=localhost:2375 Line 31: DOCKER_HOST=localhost:2375 Line 32: authenticate_with_public_ecr Line 42: aws ecr-public get-login-password --region us-east-1 Line 44: docker login --username AWS --password-stdin public.ecr.aws Error response from daemon: Get "https://public.ecr.aws/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) make: *** [Makefile:36: build] Error 1

skc1111 avatar Oct 15 '24 01:10 skc1111

> [dev_container_auto_added_stage_label  8/13] RUN yum install -y sudo &&      echo "hadoop ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers:
120.8 Amazon Linux 2023 repository                    0.0  B/s |   0  B     02:00    
120.8 Errors during downloading metadata for repository 'amazonlinux':
120.8   - Curl error (6): Couldn't resolve host name for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240819/aarch64/mirror.list [Could not resolve host: cdn.amazonlinux.com]
120.8 Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.5.20240819/aarch64/mirror.list [Could not resolve host: cdn.amazonlinux.com]

Seeing this as well in a VSCode devcontainer using public.ecr.aws/emr-on-eks/spark/emr-7.2.0:latest

ryanmalesic avatar Oct 18 '24 21:10 ryanmalesic

Is this completely reproduceable or transcient ? This domains resolves just fine wherever I try it which makes me wonder wether there's a problem with your container network setup but maybe we do have a transcient DNS issue on our side...

ozbenh avatar Oct 19 '24 09:10 ozbenh

Is this still happening ? Otherwise I'm tempted to close this as a glitch in the CDN ....

ozbenh avatar Nov 19 '24 08:11 ozbenh

I am seeing this error and it is consistently reproducible under below conditions

  • Environment: Behind the organization's proxy that uses its own certificates
  • Using: Windows Subsystem for Linux 2 (WSL2 with Ubuntu Distro)
  • Docker image: Amazon Linux 2023

Workaround:

As a workaround to get past this error, I included below steps in the Dockerfile:

  1. Copy the organization's certificates to the image's ca-trust path /etc/pki/ca-trust/source/anchors/

  2. Update the certificates using command update-ca-trust extract before other steps

FROM public.ecr.aws/amazonlinux/amazonlinux:latest

COPY my-org-certificate.crt /etc/pki/ca-trust/source/anchors/
RUN update-ca-trust extract

RUN yum update -y
RUN yum groupinstall -y "Development Tools"
...
...

Hope this helps in resolving the issue properly without needing any workarounds.

spachore avatar Mar 31 '25 07:03 spachore

To the folks who reported this (and similar) issue ... can it also be reproduced with Amazon Linux 2 ?

FROM public.ecr.aws/amazonlinux/amazonlinux:2

Also if you could try other popular linux distributions like: fedora:latest. This would help us narrow down if the issue is network configuration or something wrong with our container image or the CDN endpoint.

sktomer avatar Apr 03 '25 21:04 sktomer

I tried the following Dockerfile:

FROM public.ecr.aws/amazonlinux/amazonlinux:2

COPY cert.pem /etc/pki/ca-trust/source/anchors/cert.pem
COPY key.pem /etc/pki/ca-trust/source/anchors/key.pem
RUN update-ca-trust extract

WORKDIR /app

COPY env /app/env
COPY tests /app/tests

RUN yum install -y k6

I got the following error:

https://cdn.amazonlinux.com/2/core/2.0/x86_64/bc531fc2103715ef50af98052d276ae6bcc929adfd69cfff0b74db1e663484a9/repodata/repomd.xml?instance_id=URLError&region=unknown: [Errno 14] curl#60 - "SSL certificate problem: self signed certificate in certificate chain"

ron-hinton avatar Apr 07 '25 04:04 ron-hinton

I also used this Dockerfile:

FROM amazonlinux:2023

COPY cert.pem /etc/pki/ca-trust/source/anchors/cert.pem
COPY key.pem /etc/pki/ca-trust/source/anchors/key.pem
RUN update-ca-trust extract

WORKDIR /app

COPY env /app/env
COPY tests /app/tests

RUN yum install -y k6

Then I received this error: Curl error (60): SSL peer certificate or SSH remote key was not OK for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.7.20250331/x86_64/mirror.list [SSL certificate problem: self-signed certificate in certificate chain] 3.296 Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (60): SSL peer certificate or SSH remote key was not OK for https://cdn.amazonlinux.com/al2023/core/mirrors/2023.7.20250331/x86_64/mirror.list [SSL certificate problem: self-signed certificate in certificate chain]

ron-hinton avatar Apr 07 '25 04:04 ron-hinton

Consolidating reported errors here:

  • [Failed to connect to cdn.amazonlinux.com port 443 after 30000 ms: Timeout was reached] This seems like a network issue. The container is not able to reach cdn.amazonlinux.com. Please check company firewall rules and ensure network is set up properly for the container.

  • [SSL certificate problem: self-signed certificate in certificate chain] I noticed customers added their cert files in the container. Is the issue seen without importing any cert files ? Some options to try here, although I won't recommend disabling SSL verification.

sktomer avatar Apr 10 '25 23:04 sktomer

For my case, I was using it behind a firewall. I configured Docker to use a proxy. The proxy setting can also be modified using the Docker Desktop.

joseph-d-p avatar Aug 12 '25 10:08 joseph-d-p