Class ContainerConfigurationTemplate
- java.lang.Object
-
- com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate
-
- All Implemented Interfaces:
JsonTemplate
public class ContainerConfigurationTemplate extends java.lang.Object implements JsonTemplate
JSON Template for Docker Container Configuration referenced in Docker Manifest Schema V2.2Example container config JSON:
{ "created": "1970-01-01T00:00:00Z", "architecture": "amd64", "os": "linux", "config": { "Env": ["/usr/bin/java"], "Entrypoint": ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"], "Cmd": ["arg1", "arg2"], "Healthcheck": { "Test": ["CMD-SHELL", "/usr/bin/check-health localhost"], "Interval": 30000000000, "Timeout": 10000000000, "StartPeriod": 0, "Retries": 3 } "ExposedPorts": { "6000/tcp":{}, "8000/tcp":{}, "9000/tcp":{} }, "Volumes":{"/var/job-result-data":{},"/var/log/my-app-logs":{}}}, "Labels": { "com.example.label": "value" }, "WorkingDir": "/home/user/workspace", "User": "me" }, "history": [ { "author": "Jib", "created": "1970-01-01T00:00:00Z", "created_by": "jib" }, { "author": "Jib", "created": "1970-01-01T00:00:00Z", "created_by": "jib" } ] "rootfs": { "diff_ids": [ "sha256:2aebd096e0e237b447781353379722157e6c2d434b9ec5a0d63f2a6f07cf90c2", "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", ], "type": "layers" }
}- See Also:
- Image Manifest Version 2, Schema 2
-
-
Constructor Summary
Constructors Constructor Description ContainerConfigurationTemplate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHistoryEntry(HistoryEntry historyEntry)
void
addLayerDiffId(DescriptorDigest diffId)
java.lang.String
getArchitecture()
Returns the architecture for which this container was built.int
getLayerCount()
DescriptorDigest
getLayerDiffId(int index)
java.lang.String
getOs()
Returns the operating system for which this container was built.void
setArchitecture(java.lang.String architecture)
Sets the architecture for which this container was built.void
setContainerCmd(java.util.List<java.lang.String> cmd)
void
setContainerEntrypoint(java.util.List<java.lang.String> command)
void
setContainerEnvironment(java.util.List<java.lang.String> environment)
void
setContainerExposedPorts(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> exposedPorts)
void
setContainerHealthCheckInterval(java.lang.Long interval)
Sets interval on HealthCheck, creates an empty HealthCheck object if necessary.void
setContainerHealthCheckRetries(java.lang.Integer retries)
Sets retries on HealthCheck, creates an empty HealthCheck object if necessary.void
setContainerHealthCheckStartPeriod(java.lang.Long startPeriod)
Sets startPeriod on HealthCheck, creates an empty HealthCheck object if necessary.void
setContainerHealthCheckTest(java.util.List<java.lang.String> test)
Sets test on HealthCheck, creates an empty HealthCheck object if necessary.void
setContainerHealthCheckTimeout(java.lang.Long timeout)
Sets timeout on HealthCheck, creates an empty HealthCheck object if necessary.void
setContainerLabels(java.util.Map<java.lang.String,java.lang.String> labels)
void
setContainerUser(java.lang.String user)
void
setContainerVolumes(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> volumes)
void
setContainerWorkingDir(java.lang.String workingDirectory)
void
setCreated(java.lang.String created)
void
setOs(java.lang.String os)
Sets the operating system for which this container was built.
-
-
-
Method Detail
-
setCreated
public void setCreated(@Nullable java.lang.String created)
-
setArchitecture
public void setArchitecture(java.lang.String architecture)
Sets the architecture for which this container was built. See the OCI Image Configuration specification for acceptable values.- Parameters:
architecture
- value for thearchitecture
field
-
setOs
public void setOs(java.lang.String os)
Sets the operating system for which this container was built. See the OCI Image Configuration specification for acceptable values.- Parameters:
os
- value for theos
field
-
setContainerEnvironment
public void setContainerEnvironment(@Nullable java.util.List<java.lang.String> environment)
-
setContainerEntrypoint
public void setContainerEntrypoint(@Nullable java.util.List<java.lang.String> command)
-
setContainerCmd
public void setContainerCmd(@Nullable java.util.List<java.lang.String> cmd)
-
setContainerHealthCheckTest
public void setContainerHealthCheckTest(java.util.List<java.lang.String> test)
Sets test on HealthCheck, creates an empty HealthCheck object if necessary.- Parameters:
test
- the list of tests to set
-
setContainerHealthCheckInterval
public void setContainerHealthCheckInterval(@Nullable java.lang.Long interval)
Sets interval on HealthCheck, creates an empty HealthCheck object if necessary.- Parameters:
interval
- the interval to set
-
setContainerHealthCheckTimeout
public void setContainerHealthCheckTimeout(@Nullable java.lang.Long timeout)
Sets timeout on HealthCheck, creates an empty HealthCheck object if necessary.- Parameters:
timeout
- the timeout to configure
-
setContainerHealthCheckStartPeriod
public void setContainerHealthCheckStartPeriod(@Nullable java.lang.Long startPeriod)
Sets startPeriod on HealthCheck, creates an empty HealthCheck object if necessary.- Parameters:
startPeriod
- the start period to configure
-
setContainerHealthCheckRetries
public void setContainerHealthCheckRetries(@Nullable java.lang.Integer retries)
Sets retries on HealthCheck, creates an empty HealthCheck object if necessary.- Parameters:
retries
- the number of retries to configure
-
setContainerExposedPorts
public void setContainerExposedPorts(@Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> exposedPorts)
-
setContainerLabels
public void setContainerLabels(@Nullable java.util.Map<java.lang.String,java.lang.String> labels)
-
setContainerWorkingDir
public void setContainerWorkingDir(@Nullable java.lang.String workingDirectory)
-
setContainerUser
public void setContainerUser(@Nullable java.lang.String user)
-
setContainerVolumes
public void setContainerVolumes(@Nullable java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> volumes)
-
addLayerDiffId
public void addLayerDiffId(DescriptorDigest diffId)
-
addHistoryEntry
public void addHistoryEntry(HistoryEntry historyEntry)
-
getArchitecture
public java.lang.String getArchitecture()
Returns the architecture for which this container was built. See the OCI Image Configuration specification for acceptable values.- Returns:
- the
architecture
field
-
getOs
public java.lang.String getOs()
Returns the operating system for which this container was built. See the OCI Image Configuration specification for acceptable values.- Returns:
- the
os
field
-
getLayerDiffId
public DescriptorDigest getLayerDiffId(int index)
-
getLayerCount
public int getLayerCount()
-
-