GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.88k stars 1.44k forks source link

kaniko executor ignores /etc/hosts #1639

Open olwe0002 opened 3 years ago

olwe0002 commented 3 years ago

Actual behavior I am using gcr.io/kaniko-project/executor:debug image in a GitLab CI job to build docker images. The login/push to a private registry, which is not available in the dns, fails because of a "Bad Gateway" message. The registry needs to be accessed by dns name, because of its certificate.

Expected behavior inserting the missing IP+Hostname to the local /etc/hosts will be recognized by kaniko executor:

  1. echo "-ip- -hostname-" >> /etc/hosts
  2. run the /kaniko/executor stuff

    Description Yes/No
    Please check if this a new feature you are proposing
    • - [maybe]
    Please check if the build works in docker but not in kaniko
    • - [ yes]
    Please check if this error is seen when you use --cache flag
    • - [n/a ]
    Please check if your dockerfile is a multistage dockerfile
    • - [no ]
CharkeyQK commented 1 year ago

any release plan for this feature?

dberardo-com commented 9 months ago

is this still an issue ? and how about using kaniko in a k8s environment ? would it use coredns in that case?