All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.gradle.plugins.docker.SystemPackageDockerfile.groovy Maven / Gradle / Ivy

There is a newer version: 11.10.0
Show newest version
package com.netflix.gradle.plugins.docker

import com.netflix.gradle.plugins.packaging.AbstractPackagingCopyAction
import com.netflix.gradle.plugins.packaging.SystemPackagingTask
import org.gradle.tooling.model.UnsupportedMethodException
import org.gradle.work.DisableCachingByDefault

@DisableCachingByDefault
class SystemPackageDockerfile extends SystemPackagingTask {
    private final DockerfileInstructionManager dockerfileInstructionManager
    private static final ARCHIVE_NAME = 'Dockerfile'

    SystemPackageDockerfile() {
        dockerfileInstructionManager = new DockerfileInstructionManager()
    }

    @Override
    String assembleArchiveName() {
        ARCHIVE_NAME
    }

    @Override
    AbstractPackagingCopyAction createCopyAction() {
        new DockerCopyAction(this, dockerfileInstructionManager)
    }

    @Override
    String getArchString() {
        throw new UnsupportedMethodException('The architecture is defined through FROM instruction in Docker images')
    }

    void instruction(String instruction) {
        dockerfileInstructionManager.addInstruction(instruction)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy