Class CreateNetworkTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.github.pgatzka.docker.task.DockerTask
io.github.pgatzka.docker.task.network.CreateNetworkTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@UntrackedTask(because="Docker daemon side effects must always run") public abstract class CreateNetworkTask extends DockerTask
Creates a Docker network according to its NetworkSpec.

Idempotent: a no-op when a network with the same name already exists (driver, internal, attachable, and labels are not reconciled). Marked UntrackedTask because the daemon side effect must always run.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Invoked by Gradle's bytecode-decorated subclass; not for direct use.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Gradle entry point for this task.
    abstract org.gradle.api.provider.Property<Boolean>
    Mirrors NetworkSpec.attachable: when true, standalone containers may attach to this network.
    abstract org.gradle.api.provider.Property<String>
    Mirrors NetworkSpec.driver: the network driver (e.g.
    abstract org.gradle.api.provider.Property<Boolean>
    Mirrors NetworkSpec.internal: when true, the network is isolated from external networks.
    abstract org.gradle.api.provider.MapProperty<String,String>
    Mirrors NetworkSpec.labels: labels applied to the network on the daemon.
    abstract org.gradle.api.provider.Property<String>
    Mirrors NetworkSpec.name: the network name registered on the daemon.

    Methods inherited from class io.github.pgatzka.docker.task.DockerTask

    getDockerService

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • CreateNetworkTask

      public CreateNetworkTask()
      Invoked by Gradle's bytecode-decorated subclass; not for direct use.
  • Method Details

    • getNetworkName

      @Input public abstract org.gradle.api.provider.Property<String> getNetworkName()
      Mirrors NetworkSpec.name: the network name registered on the daemon.
      Returns:
      the network name property
    • getDriver

      @Input public abstract org.gradle.api.provider.Property<String> getDriver()
      Mirrors NetworkSpec.driver: the network driver (e.g. bridge).
      Returns:
      the network driver property
    • getLabels

      @Input public abstract org.gradle.api.provider.MapProperty<String,String> getLabels()
      Mirrors NetworkSpec.labels: labels applied to the network on the daemon.
      Returns:
      the labels property
    • getInternal

      @Input public abstract org.gradle.api.provider.Property<Boolean> getInternal()
      Mirrors NetworkSpec.internal: when true, the network is isolated from external networks.
      Returns:
      the internal flag property
    • getAttachable

      @Input public abstract org.gradle.api.provider.Property<Boolean> getAttachable()
      Mirrors NetworkSpec.attachable: when true, standalone containers may attach to this network.
      Returns:
      the attachable flag property
    • execute

      public void execute()
      Gradle entry point for this task. Delegates to the package-private run(DockerClient, String, String, Map, boolean, boolean, Logger) helper.