Interface ContainerizeTask

All Superinterfaces:
Task<ContainerizeTask.ContainerImage,ContainerizeTask>

public interface ContainerizeTask extends Task<ContainerizeTask.ContainerImage,ContainerizeTask>

A task for creating container images of the project application.

This task supports the creation of Docker or OCI images packaged as portable TAR archives or directly deployed to a local Docker daemon or to a remote registry.

This task depends on PackageApplicationTask.

Since:
1.4
Author:
Jeremy Kuhn
  • Method Details

    • target

      Specifies where to generate the image.

      Defaults to ContainerizeTask.Target.TAR.

      Parameters:
      target - the image target
      Returns:
      the task
    • from

      Specifies the base container image.

      Defaults to debian:stable-slim.

      Parameters:
      from - the base container image
      Returns:
      the task
    • executable

      ContainerizeTask executable(String executable)

      Specifies the image executable.

      Defaults to Artifact.getName().

      Parameters:
      executable - the image executable
      Returns:
      the task
    • format

      Specifies the image format.

      Defaults to ContainerizeTask.Format.OCI.

      Parameters:
      format - the image format.
      Returns:
      the task
    • repository

      ContainerizeTask repository(String repository)

      Specifies the image repository.

      Parameters:
      repository - the image repository.
      Returns:
      the task
    • registry

      ContainerizeTask registry(String registry)

      Specifies the image registry where to deploy the image.

      Parameters:
      registry - the image registry.
      Returns:
      the task
    • registryUsername

      ContainerizeTask registryUsername(String registryUsername)

      Specifies the username to use to connect to the image registry.

      Parameters:
      registryUsername - the registry username
      Returns:
      the task
    • registryPassword

      ContainerizeTask registryPassword(String registryPassword)

      Specifies the password to use to connect to the image registry.

      Parameters:
      registryPassword - the registry password
      Returns:
      the task
    • dockerExecutable

      ContainerizeTask dockerExecutable(Path dockerExecutable)

      Specifies the path to the Docker CLI executable used to install the image in the Docker daemon.

      Parameters:
      dockerExecutable - the path to the docker executable
      Returns:
      the task
    • dockerEnvironment

      ContainerizeTask dockerEnvironment(Map<String,String> dockerEnvironment)

      Specifies the Docker environment variables used when executing the Docker CLI executable.

      Parameters:
      dockerEnvironment - the docker environment variables
      Returns:
      the task
    • labels

      ContainerizeTask labels(Map<String,String> labels)

      Specifies the labels to apply to the image.

      Parameters:
      labels - the image labels
      Returns:
      the task
    • ports

      ContainerizeTask ports(Set<String> ports)

      Specifies the ports exposed by the container at runtime defined as: port_number [ "/" udp/tcp ] .

      Parameters:
      ports - the ports to expose
      Returns:
      the task
    • volumes

      ContainerizeTask volumes(Set<String> volumes)

      Specifies the container's mount points.

      Parameters:
      volumes - the image volumes
      Returns:
      the task
    • user

      Specifies the user and group used to run the container defined as: user / uid [ ":" group / gid ].

      Parameters:
      user - the user and group used to run the container
      Returns:
      the task
    • environment

      ContainerizeTask environment(Map<String,String> environment)

      Specifies the container's environment variables.

      Parameters:
      environment - the container's environment variables
      Returns:
      the task