Class Run
- java.lang.Object
-
- com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand<Run>
-
- com.oracle.bedrock.runtime.docker.commands.Run
-
- All Implemented Interfaces:
com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
public class Run extends AbstractDockerCommand<Run>
A representation of the Docker run command.Instances of
Runare immutable, methods that add options and configuration to thisRuncommand return a new instance of aRuncommand 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RunaddCapability(Object... capabilities)RunaddHost(Object... hostMappings)Runattach()RunautoRemove()RunblockIOWeight(int weight)RunblockIOWeightDevice(int weight)RuncgroupParent(String parent)RuncidFile(File file)RuncpuPeriod(int value)RuncpuQuota(int value)RuncpuSetCPUs(String value)RuncpuSetMems(String value)RuncpuShares(int weight)Rundetach(String name)Rundetached()RundetachKeys(String keys)Rundevice(Object... names)RundeviceReadBytesPerSec(String... values)RundeviceReadIOPS(String... values)RundeviceWriteBytesPerSec(String... values)RundeviceWriteIOPS(String... values)RundisableContentTrust()Rundns(String... servers)RundnsOptions(String... options)RundnsSearch(String... domains)RundropCapability(Object... capabilities)RunenableContentTrust()RunentryPoint(String entrypoint)Runenv(String name)Runenv(String name, Object value)Runenv(Properties variables)Create a newRuncommand that is a copy of thisRuncommand with the--envoption applied using the specified environment variable names and values from the specifiedProperties.RunenvFile(File file)Runexpose(Object... ports)RungroupAdd(String... groups)RunhostName(String name)static Runimage(DockerImage image)Create aRuncommand to run a container from the specifiedDockerImagename.static Runimage(DockerImage image, Object containerName)Create aRuncommand to run a container from the specified image name.static Runimage(String image)Create aRuncommand to run a container from the specified image name.static Runimage(String image, Object containerName)Create aRuncommand to run a container from the specified image name.Runinteractive()Runip(String address)Runip6(String address)Runipc(String namespace)Runisolation(String value)RunkernalMemory(String limit)RunlabelFile(File... files)Runlabels(Object... values)Runlink(Object... containers)Runlink(List<?> containers)RunlogDriver(String name)RunlogOptions(Object... options)RunmacAddress(String address)Runmemory(String limit)RunmemoryReservation(String limit)RunmemorySwap(int swap)RunmemorySwappiness(int swap)Runnet(String name)RunnetAlias(String... aliases)RunnetBridge()RunnetContainer(String container)RunnetHost()RunnetNone()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)RunoomKillDisabled()RunoomScoreAdjust(int score)Runpid(String namespace)RunpidsLimit(int limit)Runprivileged(int limit)Runpublish(Object... portMappings)Runpublish(Collection<?> portMappings)RunpublishAll()RunreadOnly()Runrestart(String policy)RunrestartAlways()RunrestartNo()RunrestartOnFailure()RunrestartOnFailure(int maxRetries)RunrestartUnlessStopped()Runrm()RunsecurityOptions(Object... options)RunshmSize(Object... values)RunsignalProxy(boolean enabled)RunstopSignal(String signal)Runtty()Runulimit(Object... options)Runuser(String username)RunuserNamespace(String namespace)RunutsNamespace(Object... options)Runvolume(Object... volumes)RunvolumeDriver(String name)RunvolumesFrom(String... containers)RunwithCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)Obtain a copy of thisAbstractDockerCommandwith the addition of the specified command argumentsArguments.RunwithoutCommandArguments(com.oracle.bedrock.runtime.options.Argument... args)Obtain a copy of thisAbstractDockerCommandwithout the specified command argumentsArguments.RunworkinDirectory(File file)-
Methods inherited from class com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand
getCommandArguments, getImplementationClass, getTimeout, onLaunching, timeoutAfter, timeoutAfter
-
-
-
-
Method Detail
-
withCommandArguments
public Run 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<Run>- Parameters:
args- the additionalArguments- Returns:
- a copy of this
AbstractDockerCommandwith the addition of the specifiedArguments
-
withoutCommandArguments
public Run 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<Run>- Parameters:
args- the additionalArguments- Returns:
- a copy of this
AbstractDockerCommandwithout the specifiedArguments
-
detached
public Run detached()
-
interactive
public Run interactive()
-
tty
public Run tty()
-
env
public Run env(Properties variables)
Create a newRuncommand that is a copy of thisRuncommand with the--envoption applied using the specified environment variable names and values from the specifiedProperties.
-
publishAll
public Run publishAll()
-
publish
public Run publish(Collection<?> portMappings)
-
autoRemove
public Run autoRemove()
-
attach
public Run attach()
-
blockIOWeight
public Run blockIOWeight(int weight)
-
blockIOWeightDevice
public Run blockIOWeightDevice(int weight)
-
cpuShares
public Run cpuShares(int weight)
-
cpuPeriod
public Run cpuPeriod(int value)
-
cpuQuota
public Run cpuQuota(int value)
-
disableContentTrust
public Run disableContentTrust()
-
enableContentTrust
public Run enableContentTrust()
-
memorySwap
public Run memorySwap(int swap)
-
memorySwappiness
public Run memorySwappiness(int swap)
-
netNone
public Run netNone()
-
netBridge
public Run netBridge()
-
netHost
public Run netHost()
-
oomKillDisabled
public Run oomKillDisabled()
-
oomScoreAdjust
public Run oomScoreAdjust(int score)
-
pidsLimit
public Run pidsLimit(int limit)
-
privileged
public Run privileged(int limit)
-
readOnly
public Run readOnly()
-
restartAlways
public Run restartAlways()
-
restartNo
public Run restartNo()
-
restartOnFailure
public Run restartOnFailure()
-
restartOnFailure
public Run restartOnFailure(int maxRetries)
-
restartUnlessStopped
public Run restartUnlessStopped()
-
rm
public Run rm()
-
shmSize
public Run shmSize(Object... values)
Create a newRuncommand that is a copy of thisRuncommand 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`.
-
signalProxy
public Run signalProxy(boolean enabled)
-
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<Run>
-
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<Run>
-
image
public static Run image(String image)
Create aRuncommand to run a container from the specified image name.The resulting container will be given a random name.
- Parameters:
image- the name of the image- Returns:
- a
Runcommand to run a container from the specified image name
-
image
public static Run image(String image, Object containerName)
Create aRuncommand to run a container from the specified image name.- Parameters:
image- the image namecontainerName- a value that will resolve to a unique container name- Returns:
- a
Runcommand to run a container from the specified image name
-
image
public static Run image(DockerImage image)
Create aRuncommand to run a container from the specifiedDockerImagename.The resulting container will be given a random name.
- Parameters:
image- theDockerImagerepresenting the image to use- Returns:
- a
Runcommand to run a container from the specified image name
-
image
public static Run image(DockerImage image, Object containerName)
Create aRuncommand to run a container from the specified image name.- Parameters:
image- the name of the imagecontainerName- a value that will resolve to a unique container name- Returns:
- a
Runcommand to run a container from the specified image
-
-