Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Error when building docker image

Đang mở
#956 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
docker, ruby
Lĩnh vực
build-system, devops

Hướng nghiên cứu

Bắt đầu bằng cách đọc các target image và image_alpine trong Makefile, sau đó kiểm tra Dockerfile và Dockerfile.alpine quanh các lệnh cài đặt gói. Tái hiện cả hai lần build và xác định liệu các lỗi kết nối đến repository được báo cáo là do môi trường hay cần thay đổi trong dự án. Hoàn tất khi cả hai target image build thành công mà không gặp các lỗi cài đặt gói.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When trying to build a Docker image, I got the following error:

$ make image
docker build -t gh-pages .
[+] Building 40.5s (6/15)                                        docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 799B                                       0.0s
 => [internal] load metadata for docker.io/library/ruby:3.3                2.7s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 108B                                          0.0s
 => CACHED [ 1/11] FROM docker.io/library/ruby:3.3@sha256:6fd8d27b52e3008  0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 5.94kB                                        0.0s
 => ERROR [ 2/11] RUN apt-get update   && apt-get install -y     git      37.7s
------                                                                          
 > [ 2/11] RUN apt-get update   && apt-get install -y     git     locales     make     nodejs:                                                                  
30.64 Ign:1 http://deb.debian.org/debian bookworm InRelease                     
30.64 Ign:2 http://deb.debian.org/debian bookworm-updates InRelease             
30.64 Ign:3 http://deb.debian.org/debian-security bookworm-security InRelease   
31.64 Ign:1 http://deb.debian.org/debian bookworm InRelease
31.64 Ign:2 http://deb.debian.org/debian bookworm-updates InRelease
31.64 Ign:3 http://deb.debian.org/debian-security bookworm-security InRelease
33.64 Ign:1 http://deb.debian.org/debian bookworm InRelease
33.64 Ign:2 http://deb.debian.org/debian bookworm-updates InRelease
33.64 Ign:3 http://deb.debian.org/debian-security bookworm-security InRelease
37.64 Err:1 http://deb.debian.org/debian bookworm InRelease
37.64   Could not connect to debian.map.fastlydns.net:80 (151.101.90.132), connection timed out Unable to connect to deb.debian.org:http:
37.64 Err:2 http://deb.debian.org/debian bookworm-updates InRelease
37.64   Unable to connect to deb.debian.org:http:
37.64 Err:3 http://deb.debian.org/debian-security bookworm-security InRelease
37.64   Unable to connect to deb.debian.org:http:
37.65 Reading package lists...
37.67 W: Failed to fetch http://deb.debian.org/debian/dists/bookworm/InRelease  Could not connect to debian.map.fastlydns.net:80 (151.101.90.132), connection timed out Unable to connect to deb.debian.org:http:
37.67 W: Failed to fetch http://deb.debian.org/debian/dists/bookworm-updates/InRelease  Unable to connect to deb.debian.org:http:
37.67 W: Failed to fetch http://deb.debian.org/debian-security/dists/bookworm-security/InRelease  Unable to connect to deb.debian.org:http:
37.67 W: Some index files failed to download. They have been ignored, or old ones used instead.
37.69 Reading package lists...
37.71 Building dependency tree...
37.71 Reading state information...
37.71 Package locales is not available, but is referred to by another package.
37.71 This may mean that the package is missing, has been obsoleted, or
37.71 is only available from another source
37.71 
37.71 E: Package 'locales' has no installation candidate
37.71 E: Unable to locate package nodejs
------

 3 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 29)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 27)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 28)
Dockerfile:4
--------------------
   3 |     
   4 | >>> RUN apt-get update \
   5 | >>>   && apt-get install -y \
   6 | >>>     git \
   7 | >>>     locales \
   8 | >>>     make \
   9 | >>>     nodejs
  10 |     
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c apt-get update   && apt-get install -y     git     locales     make     nodejs" did not complete successfully: exit code: 100
make: *** [Makefile:7: image] Error 1

For make image_alpine, the following error occurs

$ make image_alpine 
docker build -t gh-pages . -f Dockerfile.alpine
[+] Building 120.6s (6/9)                                        docker:default
 => [internal] load build definition from Dockerfile.alpine                0.0s
 => => transferring dockerfile: 613B                                       0.0s
 => WARN: LegacyKeyValueFormat: "ENV key=value" should be used instead of  0.0s
 => WARN: LegacyKeyValueFormat: "ENV key=value" should be used instead of  0.0s
 => WARN: LegacyKeyValueFormat: "ENV key=value" should be used instead of  0.0s
 => [internal] load metadata for docker.io/library/ruby:3.3-alpine         0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 108B                                          0.0s
 => [internal] load build context                                          0.1s
 => => transferring context: 1.91MB                                        0.1s
 => CACHED [1/5] FROM docker.io/library/ruby:3.3-alpine                    0.0s
 => ERROR [2/5] RUN apk update && apk add --no-cache   git               120.5s
------                                                                          
 > [2/5] RUN apk update && apk add --no-cache   git:                            
0.245 fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz                                                                             
60.34 WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.22/main: Permission denied                                                         
60.34 fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/community/x86_64/APKINDEX.tar.gz
120.5 4 unavailable, 0 stale; 21 distinct packages available
120.5 WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.22/community: Permission denied
------

 3 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 16)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 17)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 18)
Dockerfile.alpine:3
--------------------
   2 |     
   3 | >>> RUN apk update && apk add --no-cache \
   4 | >>>   git
   5 |     
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c apk update && apk add --no-cache   git" did not complete successfully: exit code: 4
make: *** [Makefile:9: image_alpine] Error 1
Ngôn ngữ chính
Ruby
Star
1.9k
Fork
361
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/pages-gem

Tất cả issue của github/pages-gem

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.