Class DockerClient.BuildParam

java.lang.Object
com.spotify.docker.client.DockerClient.Param
com.spotify.docker.client.DockerClient.BuildParam
Enclosing interface:
DockerClient

public static class DockerClient.BuildParam extends DockerClient.Param
Flags which can be passed to the build method.
  • Constructor Details

    • BuildParam

      public BuildParam(String name, String value)
  • Method Details

    • name

      public static DockerClient.BuildParam name(String name)
      Repository name (and optionally a tag) to be applied to the resulting image in case of success.

      You could also pass the name explicitly to DockerClient.build(Path, String, BuildParam...) or one of the other build methods that takes an explicit name.

      Parameters:
      name - A name to apply to the image
      Returns:
      BuildParam
    • create

      public static DockerClient.BuildParam create(String name, String value)
      Create a custom parameter.
      Parameters:
      name - custom name
      value - custom value
      Returns:
      BuildParam
    • quiet

      public static DockerClient.BuildParam quiet()
      Suppress verbose build output.
      Returns:
      BuildParam
    • rm

      public static DockerClient.BuildParam rm()
      Remove intermediate containers after a successful build.
      Returns:
      BuildParam
    • rm

      public static DockerClient.BuildParam rm(boolean rm)
      Control whether to remove intermediate containers after a successful build.
      Parameters:
      rm - Whether to remove
      Returns:
      BuildParam
    • noCache

      public static DockerClient.BuildParam noCache()
      Do not use the cache when building the image.
      Returns:
      BuildParam
    • forceRm

      public static DockerClient.BuildParam forceRm()
      Always remove intermediate containers.
      Returns:
      BuildParam
    • pullNewerImage

      public static DockerClient.BuildParam pullNewerImage()
      Always attempt to pull a newer version of the base image even if one exists locally.
      Returns:
      BuildParam
    • dockerfile

      public static DockerClient.BuildParam dockerfile(Path dockerfile)
      path within the build context to the Dockerfile. This is ignored if remote(URI) is specified and points to an individual filename.

      You could also pass the dockerfile path explicitly to DockerClient.build(Path, String, String, ProgressHandler, BuildParam...) or one of the other build methods that takes an explicit dockerfile path.

      Parameters:
      dockerfile - Path to the dockerfile in the build context.
      Returns:
      BuildParam
    • remote

      public static DockerClient.BuildParam remote(URI remote)
      A Git repository URI or HTTP/HTTPS URI build source. If the URI specifies a filename, the file's contents are placed into a file called `Dockerfile`.
      Parameters:
      remote - A Git repository URI or HTTP/HTTPS URI build source.
      Returns:
      BuildParam
    • memory

      public static DockerClient.BuildParam memory(Integer memory)
      Set memory limit for build.
      Parameters:
      memory - Memory limit for build, in bytes.
      Returns:
      BuildParam
    • totalMemory

      public static DockerClient.BuildParam totalMemory(Integer totalMemory)
      Total memory (memory + swap). Set to -1 to enable unlimited swap.
      Parameters:
      totalMemory - Total memory (memory + swap) in bytes.
      Returns:
      BuildParam
    • cpuShares

      public static DockerClient.BuildParam cpuShares(Integer cpuShares)
      CPU shares (relative weight).
      Parameters:
      cpuShares - CPU shares (relative weight).
      Returns:
      BuildParam
    • cpusetCpus

      public static DockerClient.BuildParam cpusetCpus(Integer cpusetCpus)
      CPUs in which to allow execution, e.g. 0-3, 0,1.
      Parameters:
      cpusetCpus - CPUs in which to allow execution
      Returns:
      BuildParam