gradle-docker-plugin icon indicating copy to clipboard operation
gradle-docker-plugin copied to clipboard

Creating inline files with here-doc in Dockerfile doesn't work

Open shollander opened this issue 1 year ago • 2 comments

Expected Behavior

The following Dockerfile should work (https://docs.docker.com/reference/dockerfile/#example-creating-inline-files):

FROM alpine
COPY <<EOF /etc/myconf
setting1=value
EOF

Current Behavior

Fails with the following error:

Could not build image: COPY failed: no source files were specified

The Dockerfile works fine with commandline docker build.

shollander avatar Nov 04 '24 16:11 shollander

I'd have to see the task that you are running. Can you provide your build logic?

bmuschko avatar Nov 07 '24 14:11 bmuschko

This is my Gradle task:

tasks.register("buildDockerImage", DockerBuildImage) {
    inputDir = project.projectDir
    images.add("me/myImage")
}

shollander avatar Nov 12 '24 20:11 shollander