Dockerfile ADD an artifact from an artifactory that requires authentication


I’d like to build an image by adding an artifact to an Ubuntu base image. The trick is that the artifactory is password-protected; thus, I need to provide the username and password, and I don’t want to save them in the Dockerfile. So, my question is what is the best practice to do it? Thank you.


A better way is to provide any credentials (usernames, passwords, tokens, anything sensitive) as environment variables at runtime.


1 Like