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

Docker build failed, is it due to my environment not right? #9

Open
OneCodeMonkey opened this issue Nov 14, 2024 · 4 comments
Open

Comments

@OneCodeMonkey
Copy link

OneCodeMonkey commented Nov 14, 2024

System: CentOS Stream release 8
Docker version: Docker version 26.1.3, build b72abbb
Operation: cd /home/www/ryugod/docker/ && ./build_all.sh

output:

------------> Building image aardvark... <------------
ionice -c 3 docker build -t ryusatgat/ubuntu -f in/Dockerfile.in --build-arg FROM_IMAGE=ubuntu:latest in
[+] Building 0.6s (15/15) FINISHED                                                                              docker:default
 => [internal] load build definition from Dockerfile.in                                                                   0.0s
 => => transferring dockerfile: 1.16kB                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest                                                          0.5s
 => [internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [internal] load build context                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [ 1/11] FROM docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e  0.0s
 => => resolve docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e    0.0s
 => CACHED [ 2/11] RUN apt-get update; apt-get -y upgrade; true                                                           0.0s
 => CACHED [ 3/11] RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils net-tools git   0.0s
 => CACHED [ 4/11] RUN apt install -y ca-certificates && update-ca-certificates                                           0.0s
 => CACHED [ 5/11] RUN locale-gen ko_KR.utf8 en_US.utf8                                                                   0.0s
 => CACHED [ 6/11] RUN deluser ubuntu; echo                                                                               0.0s
 => CACHED [ 7/11] RUN groupadd --gid 1000 ryugod     && useradd --uid 1000 --password ryugod -m --gid 1000 -m ryugod --  0.0s
 => CACHED [ 8/11] RUN echo ryugod ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/ryugod     && chmod 0440 /etc/sudoers.d/ryug  0.0s
 => CACHED [ 9/11] RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime                                               0.0s
 => CACHED [10/11] RUN echo 'export PS1="\[\e[m\]\[\e[32;5;172m\]\u\[\e[m\]@\[\e[33;5;153m\]\h\[\e[m\] \[\e[38;5;214m\]\  0.0s
 => ERROR [11/11] ADD usr /usr                                                                                            0.0s
------
 > [11/11] ADD usr /usr:
------
Dockerfile.in:31
--------------------
  29 |     RUN echo 'export PS1="\[\e[m\]\[\e[32;5;172m\]\u\[\e[m\]@\[\e[33;5;153m\]\h\[\e[m\] \[\e[38;5;214m\]\W\[\e[m\]\$ "' >> /home/$USERNAME/.bashrc
  30 |
  31 | >>> ADD usr /usr
  32 |
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 2dd1ea36-d5ab-41d4-87f1-f877b4f864e1::mavi5xbdhtopmqt1fc7dc76et: "/usr": not found
make: *** [Makefile:44:ryusatgat/ubuntu] 错误 1
------------> Building image amp... <------------
ionice -c 3 docker build -t ryusatgat/ubuntu -f in/Dockerfile.in --build-arg FROM_IMAGE=ubuntu:latest in
[+] Building 0.3s (15/15) FINISHED                                                                              docker:default
 => [internal] load build definition from Dockerfile.in                                                                   0.0s
 => => transferring dockerfile: 1.16kB                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest                                                          0.3s
 => [internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [internal] load build context                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [ 1/11] FROM docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e  0.0s
 => => resolve docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e    0.0s
 => CACHED [ 2/11] RUN apt-get update; apt-get -y upgrade; true                                                           0.0s
 => CACHED [ 3/11] RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils net-tools git   0.0s
 => CACHED [ 4/11] RUN apt install -y ca-certificates && update-ca-certificates                                           0.0s
 => CACHED [ 5/11] RUN locale-gen ko_KR.utf8 en_US.utf8                                                                   0.0s
 => CACHED [ 6/11] RUN deluser ubuntu; echo                                                                               0.0s
 => CACHED [ 7/11] RUN groupadd --gid 1000 ryugod     && useradd --uid 1000 --password ryugod -m --gid 1000 -m ryugod --  0.0s
 => CACHED [ 8/11] RUN echo ryugod ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/ryugod     && chmod 0440 /etc/sudoers.d/ryug  0.0s
 => CACHED [ 9/11] RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime                                               0.0s
 => CACHED [10/11] RUN echo 'export PS1="\[\e[m\]\[\e[32;5;172m\]\u\[\e[m\]@\[\e[33;5;153m\]\h\[\e[m\] \[\e[38;5;214m\]\  0.0s
 => ERROR [11/11] ADD usr /usr                                                                                            0.0s
------
 > [11/11] ADD usr /usr:
------
Dockerfile.in:31
--------------------
  29 |     RUN echo 'export PS1="\[\e[m\]\[\e[32;5;172m\]\u\[\e[m\]@\[\e[33;5;153m\]\h\[\e[m\] \[\e[38;5;214m\]\W\[\e[m\]\$ "' >> /home/$USERNAME/.bashrc
  30 |
  31 | >>> ADD usr /usr
  32 |
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 2dd1ea36-d5ab-41d4-87f1-f877b4f864e1::m7typri7g17kuf7a4k6vexlcw: "/usr": not found
make: *** [Makefile:44:ryusatgat/ubuntu] 错误 1
------------> Building image ante... <------------
ionice -c 3 docker build -t ryusatgat/ubuntu -f in/Dockerfile.in --build-arg FROM_IMAGE=ubuntu:latest in
[+] Building 0.2s (15/15) FINISHED                                                                              docker:default
 => [internal] load build definition from Dockerfile.in                                                                   0.0s
 => => transferring dockerfile: 1.16kB                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest                                                          0.1s
 => [internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [ 1/11] FROM docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e  0.0s
 => => resolve docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e    0.0s
 => [internal] load build context                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => CACHED [ 2/11] RUN apt-get update; apt-get -y upgrade; true                                                           0.0s
 => CACHED [ 3/11] RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils net-tools git   0.0s
 => CACHED [ 4/11] RUN apt install -y ca-certificates && update-ca-certificates                                           0.0s
 => CACHED [ 5/11] RUN locale-gen ko_KR.utf8 en_US.utf8                                                                   0.0s
 => CACHED [ 6/11] RUN deluser ubuntu; echo                                                                               0.0s
 => CACHED [ 7/11] RUN groupadd --gid 1000 ryugod     && useradd --uid 1000 --password ryugod -m --gid 1000 -m ryugod --  0.0s
 => CACHED [ 8/11] RUN echo ryugod ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/ryugod     && chmod 0440 /etc/sudoers.d/ryug  0.0s
 => CACHED [ 9/11] RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime                                               0.0s
 => CACHED [10/11] RUN echo 'export PS1="\[\e[m\]\[\e[32;5;172m\]\u\[\e[m\]@\[\e[33;5;153m\]\h\[\e[m\] \[\e[38;5;214m\]\  0.0s
 => ERROR [11/11] ADD usr /usr                                                                                            0.0s
------
 > [11/11] ADD usr /usr:
------
Dockerfile.in:31
--------------------
  29 |     RUN echo 'export PS1="\[\e[m\]\[\e[32;5;172m\]\u\[\e[m\]@\[\e[33;5;153m\]\h\[\e[m\] \[\e[38;5;214m\]\W\[\e[m\]\$ "' >> /home/$USERNAME/.bashrc
  30 |
  31 | >>> ADD usr /usr
  32 |
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 2dd1ea36-d5ab-41d4-87f1-f877b4f864e1::jilx84kbpdvertxsw1e2lsv7h: "/usr": not found
make: *** [Makefile:44:ryusatgat/ubuntu] 错误 1
------------> Building image arch... <------------
ionice -c 3 docker build -t ryusatgat/arch -f in/Dockerfile.in_arch --build-arg FROM_IMAGE=archlinux in
[+] Building 0.5s (2/2) FINISHED                                                                                docker:default
 => [internal] load build definition from Dockerfile.in_arch                                                              0.0s
 => => transferring dockerfile: 867B                                                                                      0.0s
 => ERROR [internal] load metadata for docker.io/library/archlinux:latest                                                 0.4s
------
 > [internal] load metadata for docker.io/library/archlinux:latest:
------
ERROR: failed to run Build function: Canceled: context canceled
make: *** [Makefile:44:ryusatgat/arch] 错误 1
@ryusatgat
Copy link
Owner

ryusatgat commented Nov 14, 2024

You're absolutely right. The usr directory wasn’t committed. I’ll upload the relevant content.
Binary or prebuilt content will be ignored. If you encounter another Dockerfile error, simply create an opt or usr directory within each language directory.
Thank you!

@OneCodeMonkey
Copy link
Author

another error while apt-get install ca-certificates:

output:

------------> Building image aardvark... <------------
ionice -c 3 docker build -t ryusatgat/ubuntu -f in/Dockerfile.in --build-arg FROM_IMAGE=ubuntu:latest in
[+] Building 245.2s (8/15)                                                                                      docker:default
 => [internal] load build definition from Dockerfile.in                                                                   0.0s
 => => transferring dockerfile: 1.16kB                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest                                                          0.7s
 => [internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [internal] load build context                                                                                         0.0s
 => => transferring context: 826B                                                                                         0.0s
 => [ 1/11] FROM docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e  3.5s
 => => resolve docker.io/library/ubuntu:latest@sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e    0.0s
 => => sha256:34fea4f31bf187bc915536831fd0afc9d214755bf700b5cdb1336c82516d154e 1.42kB / 1.42kB                            0.0s
 => => sha256:42ba2dfce475de1113d55602d40af18415897167d47c2045ec7b6d9746ff148f 529B / 529B                                0.0s
 => => sha256:df5de72bdb3b711aba4eca685b1f42c722cc8a1837ed3fbd548a9282af2d836d 1.46kB / 1.46kB                            0.0s
 => => sha256:d19f32bd9e4106d487f1a703fc2f09c8edadd92db4405d477978e8e466ab290d 30.43MB / 30.43MB                          2.1s
 => => extracting sha256:d19f32bd9e4106d487f1a703fc2f09c8edadd92db4405d477978e8e466ab290d                                 1.2s
 => [ 2/11] RUN apt-get update; apt-get -y upgrade; true                                                                240.4s
 => [ 3/11] RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils net-tools git wget vi  0.2s
 => ERROR [ 4/11] RUN apt install -y ca-certificates && update-ca-certificates                                            0.2s
------
 > [ 4/11] RUN apt install -y ca-certificates && update-ca-certificates:
0.168
0.168 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
0.168
0.170 Reading package lists...
0.178 Building dependency tree...
0.179 Reading state information...
0.179 Package ca-certificates is not available, but is referred to by another package.
0.179 This may mean that the package is missing, has been obsoleted, or
0.179 is only available from another source
0.179
0.179 E: Package 'ca-certificates' has no installation candidate
------
Dockerfile.in:19
--------------------
  17 |     RUN apt-get update; apt-get -y upgrade; true
  18 |     RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils net-tools git wget vim curl adduser sudo locales zip unzip xz-utils bzip2 upx make cmake strace binutils; echo
  19 | >>> RUN apt install -y ca-certificates && update-ca-certificates
  20 |     RUN locale-gen ko_KR.utf8 en_US.utf8
  21 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt install -y ca-certificates && update-ca-certificates" did not complete successfully: exit code: 100
make: *** [Makefile:44:ryusatgat/ubuntu] 错误 1

------------> Building image amp... <------------
ionice -c 3 docker build -t ryusatgat/ubuntu -f in/Dockerfile.in --build-arg FROM_IMAGE=ubuntu:latest in
[+] Building 0.8s (8/15)                                                                                        docker:default

@ryusatgat
Copy link
Owner

There is no erros in Dockerfile.in for me.
Remove all docker images, and try rebuild.

@OneCodeMonkey
Copy link
Author

There is no erros in Dockerfile.in for me. Remove all docker images, and try rebuild.

ok,I'll try fix,thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants