Package org.mandas.docker.client
Class DockerClient.BuildParam
- java.lang.Object
-
- org.mandas.docker.client.DockerClient.Param
-
- org.mandas.docker.client.DockerClient.BuildParam
-
- Enclosing interface:
- DockerClient
public static class DockerClient.BuildParam extends DockerClient.Param
Flags which can be passed to thebuild
method.
-
-
Constructor Summary
Constructors Constructor Description BuildParam(String name, String value)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DockerClient.BuildParam
cpusetCpus(Integer cpusetCpus)
CPUs in which to allow execution, e.g.static DockerClient.BuildParam
cpuShares(Integer cpuShares)
CPU shares (relative weight).static DockerClient.BuildParam
create(String name, String value)
Create a custom parameter.static DockerClient.BuildParam
dockerfile(Path dockerfile)
path within the build context to the Dockerfile.static DockerClient.BuildParam
forceRm()
Always remove intermediate containers.static DockerClient.BuildParam
memory(Integer memory)
Set memory limit for build.static DockerClient.BuildParam
name(String name)
Repository name (and optionally a tag) to be applied to the resulting image in case of success.static DockerClient.BuildParam
noCache()
Do not use the cache when building the image.static DockerClient.BuildParam
pullNewerImage()
Always attempt to pull a newer version of the base image even if one exists locally.static DockerClient.BuildParam
quiet()
Suppress verbose build output.static DockerClient.BuildParam
remote(URI remote)
A Git repository URI or HTTP/HTTPS URI build source.static DockerClient.BuildParam
rm()
Remove intermediate containers after a successful build.static DockerClient.BuildParam
rm(boolean rm)
Control whether to remove intermediate containers after a successful build.static DockerClient.BuildParam
totalMemory(Integer totalMemory)
Total memory (memory + swap).-
Methods inherited from class org.mandas.docker.client.DockerClient.Param
equals, hashCode, name, value
-
-
-
-
Method Detail
-
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 namevalue
- 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 ifremote(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
-
-