Read maven settings.xml

I’m new to Docker and I’ve an image which needs to connect to a repository in runtime to download a jar, but it seams that Docker container is not able to read ~/.m2/settings.xml file located in host machine.

Is there any way to let docker now where maven configuration file is located? Or actually import the maven configuration file to the container?

Thanks in advance.

you can either bind-mount the host machine’s file into the container - see

or you could build it in when you make the image.

Hi the above link doesn’t work can you please provide new link