jenkinsci / docker-plugin

Jenkins cloud plugin that uses Docker
https://plugins.jenkins.io/docker-plugin/
MIT License
487 stars 322 forks source link

Add possibility to have a custom named Dockerfile #1030

Open lars-m-leadec opened 8 months ago

lars-m-leadec commented 8 months ago

What feature do you want to see added?

We have a project setup that needs a seperate Dockerfile. We have a Dockerfile and a file called db.dockerfile.

With docker build there is a possibility to have a custom named Dockerfile "docker build -f customnamedDockerfile ."

See https://docs.docker.com/engine/reference/commandline/build/#file)

It would be nice to have that option in your plugin.

Upstream changes

No response

timtrense-leadec commented 8 months ago

Indeed that would be useful.

Since the Dockerfile might be in a parent directory or subdirectory, it would be nice to be able to specify the full relative path for it.

Also, docker build can specify a "context" to build from (by default the current directory:

docker build -f db.dockerfile .

Indicated by the . Dot here) When giving the possibility to the user to run docker build with non-default directory layouts, why not also add an option to specify the build context directory?