Skip to content

Can't build images with Dockerfile samples #1235

@armintaenzertng

Description

@armintaenzertng

Four of the provided Dockerfiles in the samples directory lead to errors when I try to build an image from them.
These are the ones under debian_vim, photon_3_layers, photon_git, and photon_openjre.

To Reproduce
docker build ./samples/debian_vim
and similar for the other sample directories.

Error in terminal

$ docker build ./samples/debian_vim
[+] Building 1.3s (5/5) FINISHED                                                                                                                                                                                                                                                                                        
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                    0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                               0.0s
 => => transferring dockerfile: 215B                                                                                                                                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/library/debian:jessie                                                                                                                                                                                                                                                   0.0s
 => [1/2] FROM docker.io/library/debian:jessie                                                                                                                                                                                                                                                                     0.0s
 => ERROR [2/2] RUN apt-get update && apt-get install -y vim && apt-get clean                                                                                                                                                                                                                                      1.2s
------                                                                                                                                                                                                                                                                                                                  
 > [2/2] RUN apt-get update && apt-get install -y vim && apt-get clean:                                                                                                                                                                                                                                                 
#0 0.888 Ign http://deb.debian.org jessie InRelease                                                                                                                                                                                                                                                                     
#0 0.888 Ign http://security.debian.org jessie/updates InRelease                                                                                                                                                                                                                                                        
#0 0.907 Ign http://deb.debian.org jessie-updates InRelease                                                                                                                                                                                                                                                             
#0 0.907 Ign http://security.debian.org jessie/updates Release.gpg                                                                                                                                                                                                                                                      
#0 0.926 Ign http://deb.debian.org jessie Release.gpg
#0 0.932 Ign http://security.debian.org jessie/updates Release
#0 0.953 Err http://security.debian.org jessie/updates/main amd64 Packages
#0 0.953   
#0 0.964 Ign http://deb.debian.org jessie-updates Release.gpg
#0 0.973 Err http://security.debian.org jessie/updates/main amd64 Packages
#0 0.973   
#0 0.985 Ign http://deb.debian.org jessie Release
#0 0.992 Err http://security.debian.org jessie/updates/main amd64 Packages
#0 0.992   
#0 1.013 Ign http://deb.debian.org jessie-updates Release
#0 1.013 Err http://security.debian.org jessie/updates/main amd64 Packages
#0 1.013   
#0 1.033 Err http://security.debian.org jessie/updates/main amd64 Packages
#0 1.033   404  Not Found [IP: 151.101.194.132 80]
#0 1.204 Err http://deb.debian.org jessie/main amd64 Packages
#0 1.204   404  Not Found
#0 1.223 Err http://deb.debian.org jessie-updates/main amd64 Packages
#0 1.223   404  Not Found
#0 1.225 W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.194.132 80]
#0 1.225 
#0 1.225 W: Failed to fetch http://deb.debian.org/debian/dists/jessie/main/binary-amd64/Packages  404  Not Found
#0 1.225 
#0 1.225 W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found
#0 1.225 
#0 1.225 E: Some index files failed to download. They have been ignored, or old ones used instead.
------
Dockerfile:4
--------------------
   2 |     # SPDX-License-Identifier: BSD-2-Clause
   3 |     FROM debian:jessie
   4 | >>> RUN apt-get update && apt-get install -y vim && apt-get clean
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y vim && apt-get clean" did not complete successfully: exit code: 100

$ docker build ./samples/photon_3_layers/
[+] Building 0.4s (5/6)                                                                                                                                                                                                                                                                                                 
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                    0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                               0.0s
 => => transferring dockerfile: 257B                                                                                                                                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/vmware/photon2:GA                                                                                                                                                                                                                                                       0.0s
 => [1/3] FROM docker.io/vmware/photon2:GA                                                                                                                                                                                                                                                                         0.0s
 => ERROR [2/3] RUN tyum install -y git && tyum clean all                                                                                                                                                                                                                                                          0.3s
------                                                                                                                                                                                                                                                                                                                  
 > [2/3] RUN tyum install -y git && tyum clean all:                                                                                                                                                                                                                                                                     
#0 0.263 curl#6: Couldn't resolve host name
#0 0.263 Error: Failed to synchronize cache for repo 'VMware Photon Linux 2.0(x86_64) Updates' from 'https://dl.bintray.com/vmware/photon_updates_2.0_x86_64'
#0 0.276 curl#6: Couldn't resolve host name
#0 0.276 Error: Failed to synchronize cache for repo 'VMware Photon Linux 2.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_release_2.0_x86_64'
#0 0.288 curl#6: Couldn't resolve host name
#0 0.288 Error: Failed to synchronize cache for repo 'VMware Photon Extras 2.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_extras_2.0_x86_64'
#0 0.290 Error(1011) : No matching packages
#0 0.290 Refreshing metadata for: 'VMware Photon Linux 2.0(x86_64) Updates'
#0 0.290 Disabling Repo: 'VMware Photon Linux 2.0(x86_64) Updates'
#0 0.290 Refreshing metadata for: 'VMware Photon Linux 2.0(x86_64)'
#0 0.290 Disabling Repo: 'VMware Photon Linux 2.0(x86_64)'
#0 0.290 Refreshing metadata for: 'VMware Photon Extras 2.0(x86_64)'
#0 0.290 Disabling Repo: 'VMware Photon Extras 2.0(x86_64)'
#0 0.290 No package git available
------
Dockerfile:4
--------------------
   2 |     # SPDX-License-Identifier: BSD-2-Clause
   3 |     FROM vmware/photon2:GA                 
   4 | >>> RUN tyum install -y git && tyum clean all
   5 |     RUN tyum install -y vim && tyum clean all
   6 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c tyum install -y git && tyum clean all" did not complete successfully: exit code: 243

$ docker build ./samples/photon_git/
[+] Building 0.4s (5/5) FINISHED                                                                                                                                                                                                                                                                                        
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                               0.0s
 => => transferring dockerfile: 215B                                                                                                                                                                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/vmware/photon:1.0                                                                                                                                                                                                                                                       0.0s
 => [1/2] FROM docker.io/vmware/photon:1.0                                                                                                                                                                                                                                                                         0.0s
 => ERROR [2/2] RUN tyum install -y git && tyum clean all                                                                                                                                                                                                                                                          0.4s
------
 > [2/2] RUN tyum install -y git && tyum clean all:
#0 0.277 curl#6: Couldn't resolve host name
#0 0.277 Error: Failed to synchronize cache for repo 'VMware Photon Linux 1.0(x86_64)Updates' from 'https://dl.bintray.com/vmware/photon_updates_1.0_x86_64'
#0 0.297 curl#6: Couldn't resolve host name
#0 0.297 Error: Failed to synchronize cache for repo 'VMware Lightwave 1.0(x86_64)' from 'https://dl.bintray.com/vmware/lightwave'
#0 0.318 curl#6: Couldn't resolve host name
#0 0.318 Error: Failed to synchronize cache for repo 'VMware Photon Linux 1.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_release_1.0_x86_64'
#0 0.341 curl#6: Couldn't resolve host name
#0 0.341 Error: Failed to synchronize cache for repo 'VMware Photon Extras 1.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_extras'
#0 0.344 Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)Updates'
#0 0.344 Disabling Repo: 'VMware Photon Linux 1.0(x86_64)Updates'
#0 0.344 Refreshing metadata for: 'VMware Lightwave 1.0(x86_64)'
#0 0.344 Disabling Repo: 'VMware Lightwave 1.0(x86_64)'
#0 0.344 Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)'
#0 0.344 Disabling Repo: 'VMware Photon Linux 1.0(x86_64)'
#0 0.344 Refreshing metadata for: 'VMware Photon Extras 1.0(x86_64)'
#0 0.344 Disabling Repo: 'VMware Photon Extras 1.0(x86_64)'
#0 0.344 No package git available
#0 0.344 Error(1011) : No matching packages
------
Dockerfile:4
--------------------
   2 |     # SPDX-License-Identifier: BSD-2-Clause
   3 |     FROM vmware/photon:1.0                 
   4 | >>> RUN tyum install -y git && tyum clean all
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c tyum install -y git && tyum clean all" did not complete successfully: exit code: 243

$ docker build ./samples/photon_openjre/
[+] Building 0.5s (5/5) FINISHED                                                                                                                                                                                                                                                                                        
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                    0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                               0.0s
 => => transferring dockerfile: 219B                                                                                                                                                                                                                                                                               0.0s
 => [internal] load metadata for docker.io/vmware/photon:1.0                                                                                                                                                                                                                                                       0.0s
 => CACHED [1/2] FROM docker.io/vmware/photon:1.0                                                                                                                                                                                                                                                                  0.0s
 => ERROR [2/2] RUN tyum install -y openjre && tyum clean all                                                                                                                                                                                                                                                      0.4s
------                                                                                                                                                                                                                                                                                                                  
 > [2/2] RUN tyum install -y openjre && tyum clean all:                                                                                                                                                                                                                                                                 
#0 0.316 curl#6: Couldn't resolve host name                                                                                                                                                                                                                                                                             
#0 0.316 Error: Failed to synchronize cache for repo 'VMware Photon Linux 1.0(x86_64)Updates' from 'https://dl.bintray.com/vmware/photon_updates_1.0_x86_64'                                                                                                                                                            
#0 0.336 curl#6: Couldn't resolve host name                                                                                                                                                                                                                                                                             
#0 0.336 Error: Failed to synchronize cache for repo 'VMware Lightwave 1.0(x86_64)' from 'https://dl.bintray.com/vmware/lightwave'                                                                                                                                                                                      
#0 0.359 curl#6: Couldn't resolve host name
#0 0.359 Error: Failed to synchronize cache for repo 'VMware Photon Linux 1.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_release_1.0_x86_64'
#0 0.379 curl#6: Couldn't resolve host name
#0 0.379 Error: Failed to synchronize cache for repo 'VMware Photon Extras 1.0(x86_64)' from 'https://dl.bintray.com/vmware/photon_extras'
#0 0.383 Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)Updates'
#0 0.383 Disabling Repo: 'VMware Photon Linux 1.0(x86_64)Updates'
#0 0.383 Refreshing metadata for: 'VMware Lightwave 1.0(x86_64)'
#0 0.383 Disabling Repo: 'VMware Lightwave 1.0(x86_64)'
#0 0.383 Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)'
#0 0.383 Disabling Repo: 'VMware Photon Linux 1.0(x86_64)'
#0 0.383 Refreshing metadata for: 'VMware Photon Extras 1.0(x86_64)'
#0 0.383 Disabling Repo: 'VMware Photon Extras 1.0(x86_64)'
#0 0.383 No package openjre available
#0 0.383 Error(1011) : No matching packages
------
Dockerfile:4
--------------------
   2 |     # SPDX-License-Identifier: BSD-2-Clause
   3 |     FROM vmware/photon:1.0                 
   4 | >>> RUN tyum install -y openjre && tyum clean all
   5 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c tyum install -y openjre && tyum clean all" did not complete successfully: exit code: 243

Expected behavior
I expect the building of images from the provided Dockerfiles to succeed.

Environment you are running Tern on

  • Tern at commit 62507ed
  • Ubuntu 22.0.4
  • Python 3.10.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions