Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfileZip: property 'archiveFile' doesn't have a configured value #471

Open
phreed opened this issue Aug 26, 2021 · 1 comment
Open

Comments

@phreed
Copy link

phreed commented Aug 26, 2021

With a subproject :docker-image I get the following error when running ./gradlew :docker-image:dockerfileZip:

A problem was found with the configuration of task ':docker-image:dockerfileZip' (type 'Zip').
  - Type 'org.gradle.api.tasks.bundling.Zip' property 'archiveFile' doesn't have a configured value.

Here are the offending lines:

Zip dockerfileZip = project.tasks.create('dockerfileZip', Zip, {
group = 'Docker'
description = 'Bundles the configured Dockerfile in a zip file'
})

Here is the documentation for setting up a Zip:

https://docs.gradle.org/current/userguide/working_with_files.html#sec:creating_archives_example

Originally I had a top level docker project.
I believe this was not a problem until I converted it into a subproject.
Here is the work around I made in my sub-project:

tasks {
    named<Zip>("dockerfileZip") {
        archiveFileName.set("${rootProject.name}.zip")
        destinationDirectory.set(layout.buildDirectory.dir("docker/dist"))
    }
}

I am using gradle v7.2

@rkotkiewicz
Copy link

I found that the problem occurs when we are not using the distribution plugin (or some other plugin that sets up zip tasks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants