question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build of Dockerfile with multistage build fails on private registry

See original GitHub issue

Description

We have private docker registry which requires authenication (we tried to pass the user and password via .m2/settings.xml, directly via CLI params and by logging in via docker, it’s all the same ). The build fails when Dockerfile contains multi-staged build (Dockerfile contains multiple FROM statements), specifically on the second FROM statement with Unable to build image [docker-develop.lnd.bz/sandbox/dmpmsbp:latest] : "Get https://docker.lnd.bz/v2/nginx/manifests/1.10: no basic auth credentials"

Info

  • d-m-p version : 0.21.0, 0.28.0 (tested on both in hope that upgrade will help)
  • Maven version (mvn -v) :
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /usr/local/Cellar/maven/3.6.0/libexec
Java version: 11.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
Default locale: en_CZ, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.2", arch: "x86_64", family: "mac"
  • Docker version :
Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:47:43 2018
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:55:00 2018
  OS/Arch:          linux/amd64
  Experimental:     true
  • If it’s a bug, how to reproduce : Sample pom.xml and Dockerfile attached. One would need private repo with authentication and docker images used in the Dockerfile not present on local system (so the download must occure). The first image is downloaded properly, the second one fails.

  • Sample project : dmpmsbp.zip maven-output.log

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:9

github_iconTop GitHub Comments

2reactions
xfhcommented, Oct 21, 2019

Thanks, I just confirmed as well, that multistage with FROM statements referring to registry-images like in your example above works.

0reactions
rohanKanojiacommented, Oct 21, 2019

@xfh: oh, okay. I would close this and investigate #1264 then 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-stage builds - Docker Documentation
This is failure-prone and hard to maintain. It's easy to insert another command and forget to continue the line using the \ character,...
Read more >
Docker Multistage Build Fails on copy from previous stage
I am working on a multistage docker build file in an attempt to add an additional war file to our base tomcat image....
Read more >
Multi-stage builds in Docker - Tools QA
Multi-stage builds work with only one Dockerfile. It allows us to build smaller images, and Dockerfile separates them into various build stages ...
Read more >
Fetching Private Go Modules During Docker Build
These problems occur because during the docker build process the git cli does not have credentials to access any private git repositories. You...
Read more >
Access Private Repositories from Your Dockerfile Without ...
How to clone from a private repository while building your Docker image without leaking your ... There is a more elegant way by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found