Class Build
- java.lang.Object
-
- com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand<Build>
-
- com.oracle.bedrock.runtime.docker.commands.Build
-
- All Implemented Interfaces:
com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
public class Build extends AbstractDockerCommand<Build>
A representation of the Docker build command.Instances of
Buildare immutable, methods that add options and configuration to thisBuildcommand return a new instance of aBuildcommand with the modifications applied.Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.- Author:
- Jonathan Knight
-
-
Field Summary
Fields Modifier and Type Field Description static com.oracle.bedrock.options.TimeoutDEFAULT_TIMEOUTThe default timeout for build commands.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildalwaysPull()BuildbuildArgs(Object... args)BuildbuildContextAt(File location)BuildbuildContextAt(URL location)BuildcgroupParent(String parent)BuildcpuPeriod(int value)BuildcpuQuota(int value)BuildcpuSetCPUs(String value)BuildcpuSetMems(String value)BuildcpuShares()BuildcpuShares(boolean enabled)BuilddisableContentTrust()BuilddockerFileName(String name)BuildenableContentTrust()BuildforceRM()BuildforceRM(boolean force)static BuildfromDockerFile()Create aBuildcommand that will build an image using the Dockerfile with the default Dockerfile name located in the working directory that the command is launched in.static BuildfromDockerFile(String dockerFileName)Create aBuildcommand that will build an image using the Dockerfile with the specified name located in the working directory that the command is launched in.Buildisolation(String value)Buildlabels(Object... values)Buildmemory(String limit)BuildmemorySwap(String swap)BuildnoCache()BuildnoCache(boolean noCache)voidonLaunch(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)voidonLaunched(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.runtime.Application application, com.oracle.bedrock.OptionsByType optionsByType)Buildquiet()Buildquiet(boolean quiet)BuildremoveIntermidiateContainers()BuildremoveIntermidiateContainers(boolean rm)BuildshmSize(Object... values)Buildulimit(Object... options)BuildwithCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)Obtain a copy of thisAbstractDockerCommandwith the addition of the specified command argumentsArguments.BuildwithoutCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)Obtain a copy of thisAbstractDockerCommandwithout the specified command argumentsArguments.BuildwithTags(Object... tags)Obtain aBuildcommand that is the same as this command with the specified --tag build argument values.-
Methods inherited from class com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand
getCommandArguments, getImplementationClass, getTimeout, onLaunching, timeoutAfter, timeoutAfter
-
-
-
-
Method Detail
-
withCommandArguments
public Build withCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)
Description copied from class:AbstractDockerCommandObtain a copy of thisAbstractDockerCommandwith the addition of the specified command argumentsArguments.Command arguments in Docker come after the command name on the command line, e.g. docker [options...] COMMAND_NAME [args...] Parts of the Docker documentation that refer to these parameters as both arguments and options. In our case we refer to them as arguments and the are applied after the command name on the command line.
- Specified by:
withCommandArgumentsin classAbstractDockerCommand<Build>- Parameters:
args- the additionalArguments- Returns:
- a copy of this
AbstractDockerCommandwith the addition of the specifiedArguments
-
withoutCommandArguments
public Build withoutCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)
Description copied from class:AbstractDockerCommandObtain a copy of thisAbstractDockerCommandwithout the specified command argumentsArguments.Command arguments in Docker come after the command name on the command line, e.g. docker [options...] COMMAND_NAME [args...] Parts of the Docker documentation that refer to these parameters as both arguments and options. In our case we refer to them as arguments and the are applied after the command name on the command line.
- Specified by:
withoutCommandArgumentsin classAbstractDockerCommand<Build>- Parameters:
args- the additionalArguments- Returns:
- a copy of this
AbstractDockerCommandwithout the specifiedArguments
-
withTags
public Build withTags(Object... tags)
Obtain aBuildcommand that is the same as this command with the specified --tag build argument values. The value equates to one or more name and optionally a tag in the 'name:tag' format- Parameters:
tags- the values to use for the --tag argument- Returns:
- a
Buildcommand that is the same as this command with the specified --tag argument values
-
cpuShares
public Build cpuShares()
-
cpuShares
public Build cpuShares(boolean enabled)
-
cpuPeriod
public Build cpuPeriod(int value)
-
cpuQuota
public Build cpuQuota(int value)
-
disableContentTrust
public Build disableContentTrust()
-
enableContentTrust
public Build enableContentTrust()
-
forceRM
public Build forceRM()
-
forceRM
public Build forceRM(boolean force)
-
noCache
public Build noCache()
-
noCache
public Build noCache(boolean noCache)
-
alwaysPull
public Build alwaysPull()
-
quiet
public Build quiet()
-
quiet
public Build quiet(boolean quiet)
-
removeIntermidiateContainers
public Build removeIntermidiateContainers()
-
removeIntermidiateContainers
public Build removeIntermidiateContainers(boolean rm)
-
shmSize
public Build shmSize(Object... values)
Create a newBuildcommand that is a copy of thisBuildcommand with the--shm-sizeoption applied.The format is `<number><unit>`. `number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses `64m`.
-
onLaunch
public void onLaunch(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)- Specified by:
onLaunchin interfacecom.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>- Overrides:
onLaunchin classAbstractDockerCommand<Build>
-
onLaunched
public void onLaunched(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.runtime.Application application, com.oracle.bedrock.OptionsByType optionsByType)- Specified by:
onLaunchedin interfacecom.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>- Overrides:
onLaunchedin classAbstractDockerCommand<Build>
-
fromDockerFile
public static Build fromDockerFile()
Create aBuildcommand that will build an image using the Dockerfile with the default Dockerfile name located in the working directory that the command is launched in.- Returns:
- a
Buildcommand
-
fromDockerFile
public static Build fromDockerFile(String dockerFileName)
Create aBuildcommand that will build an image using the Dockerfile with the specified name located in the working directory that the command is launched in.- Parameters:
dockerFileName- the docker file name- Returns:
- a
Buildcommand
-
-