| Modifier and Type | Method and Description |
|---|---|
Image.Builder |
addEnvironment(Map<String,String> environment)
Adds a map of environment variables to the current map.
|
Image.Builder |
addEnvironmentVariable(String name,
String value)
Adds an environment variable with a given name and value.
|
Image.Builder |
addExposedPorts(Set<Port> exposedPorts)
Adds items to the "ExposedPorts" field in the container configuration.
|
Image.Builder |
addHistory(HistoryEntry history)
Adds a history element to the image.
|
Image.Builder |
addLabel(String name,
String value)
Adds an item to the "Labels" field in the container configuration.
|
Image.Builder |
addLabels(Map<String,String> labels)
Adds items to the "Labels" field in the container configuration.
|
Image.Builder |
addLayer(Layer layer)
Adds a layer to the image.
|
Image.Builder |
addVolumes(Set<AbsoluteUnixPath> volumes)
Adds items to the "Volumes" field in the container configuration.
|
Image |
build() |
Image.Builder |
setArchitecture(String architecture)
Sets the image architecture.
|
Image.Builder |
setCreated(Instant created)
Sets the image creation time.
|
Image.Builder |
setEntrypoint(List<String> entrypoint)
Sets the entrypoint of the image.
|
Image.Builder |
setHealthCheck(DockerHealthCheck healthCheck)
Sets the container's healthcheck configuration.
|
Image.Builder |
setOs(String os)
Sets the image operating system.
|
Image.Builder |
setProgramArguments(List<String> programArguments)
Sets the items in the "Cmd" field in the container configuration.
|
Image.Builder |
setUser(String user)
Sets the user/group to run the container as.
|
Image.Builder |
setWorkingDirectory(String workingDirectory)
Sets the item in the "WorkingDir" field in the container configuration.
|
public Image.Builder setCreated(Instant created)
created - the creation timepublic Image.Builder setArchitecture(String architecture)
architecture - the architecturepublic Image.Builder setOs(String os)
os - the operating systempublic Image.Builder addEnvironment(@Nullable Map<String,String> environment)
environment - the map of environment variablespublic Image.Builder addEnvironmentVariable(String name, String value)
name - the name of the variablevalue - the value to set it topublic Image.Builder setEntrypoint(@Nullable List<String> entrypoint)
entrypoint - the list of entrypoint tokenspublic Image.Builder setUser(@Nullable String user)
user - the username/UID and optionally the groupname/GIDpublic Image.Builder setProgramArguments(@Nullable List<String> programArguments)
programArguments - the list of arguments to append to the image entrypointpublic Image.Builder setHealthCheck(@Nullable DockerHealthCheck healthCheck)
healthCheck - the healthcheck configurationpublic Image.Builder addExposedPorts(@Nullable Set<Port> exposedPorts)
exposedPorts - the exposed ports to addpublic Image.Builder addVolumes(@Nullable Set<AbsoluteUnixPath> volumes)
volumes - the directories to create volumespublic Image.Builder addLabels(@Nullable Map<String,String> labels)
labels - the map of labels to addpublic Image.Builder addLabel(String name, String value)
name - the name of the labelvalue - the value of the labelpublic Image.Builder setWorkingDirectory(@Nullable String workingDirectory)
workingDirectory - the working directorypublic Image.Builder addLayer(Layer layer) throws LayerPropertyNotFoundException
layer - the layer to addLayerPropertyNotFoundException - if adding the layer failspublic Image.Builder addHistory(HistoryEntry history)
history - the history object to addpublic Image build()
Copyright © 2019. All rights reserved.