Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Customizing the tar file that is expanded into the container #70

Open StFS opened 8 years ago

StFS commented 8 years ago

Hi, this is just a question.

I'm trying to customize the tar that is extracted into the container. Specifically, I want to change the name of the root directory.

I'm not quite sure how to do that for only the tar that is used for the container creation.

I've tried adding the following task to my build.gradle file:

    //...
    apply plugin: 'application'
    apply plugin: 'docker'
    ///...
    task gortoolsDocker(type: Docker) {
        applicationName = "gor-tools"
        distributions {
            main {
                contents {
                    into '/gor/'
                }
            }
        }
    }

This does change the root directory in the tar file that is extracted into the container, however, it also changes the root directory in the tar file that gets created when I call ./gradlew distTar which is something that I don't want to do.

Is there any way that I can modify just the "docker tar"?