Modifier and Type | Method and Description |
---|---|
Image.Builder |
addEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Adds a map of environment variables to the current map.
|
Image.Builder |
addEnvironmentVariable(java.lang.String name,
java.lang.String value)
Adds an environment variable with a given name and value.
|
Image.Builder |
addExposedPorts(java.util.Set<com.google.cloud.tools.jib.api.buildplan.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(java.lang.String name,
java.lang.String value)
Adds an item to the "Labels" field in the container configuration.
|
Image.Builder |
addLabels(java.util.Map<java.lang.String,java.lang.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(java.util.Set<com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath> volumes)
Adds items to the "Volumes" field in the container configuration.
|
Image |
build()
Create an
Image instance. |
Image.Builder |
setArchitecture(java.lang.String architecture)
Sets the image architecture.
|
Image.Builder |
setCreated(java.time.Instant created)
Sets the image creation time.
|
Image.Builder |
setEntrypoint(java.util.List<java.lang.String> entrypoint)
Sets the entrypoint of the image.
|
Image.Builder |
setHealthCheck(DockerHealthCheck healthCheck)
Sets the container's healthcheck configuration.
|
Image.Builder |
setOs(java.lang.String os)
Sets the image operating system.
|
Image.Builder |
setProgramArguments(java.util.List<java.lang.String> programArguments)
Sets the items in the "Cmd" field in the container configuration.
|
Image.Builder |
setUser(java.lang.String user)
Sets the user/group to run the container as.
|
Image.Builder |
setWorkingDirectory(java.lang.String workingDirectory)
Sets the item in the "WorkingDir" field in the container configuration.
|
public Image.Builder setCreated(java.time.Instant created)
created
- the creation timepublic Image.Builder setArchitecture(java.lang.String architecture)
architecture
- the architecturepublic Image.Builder setOs(java.lang.String os)
os
- the operating systempublic Image.Builder addEnvironment(@Nullable java.util.Map<java.lang.String,java.lang.String> environment)
environment
- the map of environment variablespublic Image.Builder addEnvironmentVariable(java.lang.String name, java.lang.String value)
name
- the name of the variablevalue
- the value to set it topublic Image.Builder setEntrypoint(@Nullable java.util.List<java.lang.String> entrypoint)
entrypoint
- the list of entrypoint tokenspublic Image.Builder setUser(@Nullable java.lang.String user)
user
- the username/UID and optionally the groupname/GIDpublic Image.Builder setProgramArguments(@Nullable java.util.List<java.lang.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 java.util.Set<com.google.cloud.tools.jib.api.buildplan.Port> exposedPorts)
exposedPorts
- the exposed ports to addpublic Image.Builder addVolumes(@Nullable java.util.Set<com.google.cloud.tools.jib.api.buildplan.AbsoluteUnixPath> volumes)
volumes
- the directories to create volumespublic Image.Builder addLabels(@Nullable java.util.Map<java.lang.String,java.lang.String> labels)
labels
- the map of labels to addpublic Image.Builder addLabel(java.lang.String name, java.lang.String value)
name
- the name of the labelvalue
- the value of the labelpublic Image.Builder setWorkingDirectory(@Nullable java.lang.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 add