Class 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 Run are immutable, methods that add options and configuration to this Run command return a new instance of a Run command 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
      Run addCapability​(Object... capabilities)
      Create a new Run command that is a copy of this Run command with the --cap-add option applied.
      Run addHost​(Object... hostMappings)
      Create a new Run command that is a copy of this Run command with the --add-host option applied.
      Run attach()
      Create a new Run command that is a copy of this Run command with the --attach option applied.
      Run autoRemove()
      Create a new Run command that is a copy of this Run command with the --rm option applied.
      Run blockIOWeight​(int weight)
      Create a new Run command that is a copy of this Run command with the --blkio-weight option applied.
      Run blockIOWeightDevice​(int weight)
      Create a new Run command that is a copy of this Run command with the --blkio-weight-device option applied.
      Run cgroupParent​(String parent)
      Create a new Run command that is a copy of this Run command with the --cgroup-parent option applied.
      Run cidFile​(File file)
      Create a new Run command that is a copy of this Run command with the --cidfile option applied.
      Run cpuPeriod​(int value)
      Create a new Run command that is a copy of this Run command with the --cpu-period option applied.
      Run cpuQuota​(int value)
      Create a new Run command that is a copy of this Run command with the --cpu-quota option applied.
      Run cpuSetCPUs​(String value)
      Create a new Run command that is a copy of this Run command with the --cpuset-cpus option applied.
      Run cpuSetMems​(String value)
      Create a new Run command that is a copy of this Run command with the --cpuset-mems option applied.
      Run cpuShares​(int weight)
      Create a new Run command that is a copy of this Run command with the --cpu-shares option applied.
      Run detach​(String name)
      Create a new Run command that is a copy of this Run command with the --detach option applied.
      Run detached()
      Create a new Run command that is a copy of this Run command with the option applied.
      Run detachKeys​(String keys)
      Create a new Run command that is a copy of this Run command with the --detach-keys option applied.
      Run device​(Object... names)
      Create a new Run command that is a copy of this Run command with the --device option applied.
      Run deviceReadBytesPerSec​(String... values)
      Create a new Run command that is a copy of this Run command with the --device-read-bps option applied.
      Run deviceReadIOPS​(String... values)
      Create a new Run command that is a copy of this Run command with the --device-read-iops option applied.
      Run deviceWriteBytesPerSec​(String... values)
      Create a new Run command that is a copy of this Run command with the --device-write-bps option applied.
      Run deviceWriteIOPS​(String... values)
      Create a new Run command that is a copy of this Run command with the --device-write-iops option applied.
      Run disableContentTrust()
      Create a new Run command that is a copy of this Run command with the --disable-content-trust option applied.
      Run dns​(String... servers)
      Create a new Run command that is a copy of this Run command with the --dns option applied.
      Run dnsOptions​(String... options)
      Create a new Run command that is a copy of this Run command with the --dns-opt option applied.
      Run dnsSearch​(String... domains)
      Create a new Run command that is a copy of this Run command with the --dns-search option applied.
      Run dropCapability​(Object... capabilities)
      Create a new Run command that is a copy of this Run command with the --cap-drop option applied.
      Run enableContentTrust()
      Create a new Run command that is a copy of this Run command with the --disable-content-trust option applied.
      Run entryPoint​(String entrypoint)
      Create a new Run command that is a copy of this Run command with the --entrypoint option applied.
      Run env​(String name)
      Create a new Run command that is a copy of this Run command with the --env option applied using the specified environment variable name.
      Run env​(String name, Object value)
      Create a new Run command that is a copy of this Run command with the --env option applied using the specified environment variable name and value.
      Run env​(Properties variables)
      Create a new Run command that is a copy of this Run command with the --env option applied using the specified environment variable names and values from the specified Properties.
      Run envFile​(File file)
      Create a new Run command that is a copy of this Run command with the --env-file option applied.
      Run expose​(Object... ports)
      Create a new Run command that is a copy of this Run command with the --expose option applied.
      Run groupAdd​(String... groups)
      Create a new Run command that is a copy of this Run command with the --group-add option applied.
      Run hostName​(String name)
      Create a new Run command that is a copy of this Run command with the --hostname option applied.
      static Run image​(DockerImage image)
      Create a Run command to run a container from the specified DockerImage name.
      static Run image​(DockerImage image, Object containerName)
      Create a Run command to run a container from the specified image name.
      static Run image​(String image)
      Create a Run command to run a container from the specified image name.
      static Run image​(String image, Object containerName)
      Create a Run command to run a container from the specified image name.
      Run interactive()
      Create a new Run command that is a copy of this Run command with the --interactive option applied.
      Run ip​(String address)
      Create a new Run command that is a copy of this Run command with the --ip option applied.
      Run ip6​(String address)
      Create a new Run command that is a copy of this Run command with the --ip6 option applied.
      Run ipc​(String namespace)
      Create a new Run command that is a copy of this Run command with the --ipc option applied.
      Run isolation​(String value)
      Create a new Run command that is a copy of this Run command with the --isolation option applied.
      Run kernalMemory​(String limit)
      Create a new Run command that is a copy of this Run command with the --kernel-memory option applied.
      Run labelFile​(File... files)
      Create a new Run command that is a copy of this Run command with the --label-file option applied.
      Run labels​(Object... values)
      Create a new Run command that is a copy of this Run command with the --label option applied.
      Run link​(Object... containers)
      Create a new Run command that is a copy of this Run command with the --link option applied.
      Run link​(List<?> containers)
      Create a new Run command that is a copy of this Run command with the --link option applied.
      Run logDriver​(String name)
      Create a new Run command that is a copy of this Run command with the --log-driver option applied.
      Run logOptions​(Object... options)
      Create a new Run command that is a copy of this Run command with the --log-opt option applied.
      Run macAddress​(String address)
      Create a new Run command that is a copy of this Run command with the --mac-address option applied.
      Run memory​(String limit)
      Create a new Run command that is a copy of this Run command with the --memory option applied.
      Run memoryReservation​(String limit)
      Create a new Run command that is a copy of this Run command with the --memory-reservation option applied.
      Run memorySwap​(int swap)
      Create a new Run command that is a copy of this Run command with the --memory-swap option applied.
      Run memorySwappiness​(int swap)
      Create a new Run command that is a copy of this Run command with the --memory-swappiness option applied.
      Run net​(String name)
      Create a new Run command that is a copy of this Run command with the --net option applied.
      Run netAlias​(String... aliases)
      Create a new Run command that is a copy of this Run command with the --net option applied.
      Run netBridge()
      Create a new Run command that is a copy of this Run command with the --net=bridge option applied.
      Run netContainer​(String container)
      Create a new Run command that is a copy of this Run command with the --net=container:id option applied.
      Run netHost()
      Create a new Run command that is a copy of this Run command with the --net=host option applied.
      Run netNone()
      Create a new Run command that is a copy of this Run command with the --net=none option applied.
      void onLaunch​(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.OptionsByType optionsByType)  
      void onLaunched​(com.oracle.bedrock.runtime.Platform platform, com.oracle.bedrock.runtime.Application application, com.oracle.bedrock.OptionsByType optionsByType)  
      Run oomKillDisabled()
      Create a new Run command that is a copy of this Run command with the --oom-kill-disabled option applied.
      Run oomScoreAdjust​(int score)
      Create a new Run command that is a copy of this Run command with the --oom-score-adj option applied.
      Run pid​(String namespace)
      Create a new Run command that is a copy of this Run command with the --pid option applied.
      Run pidsLimit​(int limit)
      Create a new Run command that is a copy of this Run command with the --pids-limit option applied.
      Run privileged​(int limit)
      Create a new Run command that is a copy of this Run command with the --privileged option applied.
      Run publish​(Object... portMappings)
      Create a new Run command that is a copy of this Run command with the --publish option applied.
      Run publish​(Collection<?> portMappings)
      Create a new Run command that is a copy of this Run command with the --publish option applied.
      Run publishAll()
      Create a new Run command that is a copy of this Run command with the --publish-all option applied.
      Run readOnly()
      Create a new Run command that is a copy of this Run command with the --read-only option applied.
      Run restart​(String policy)
      Create a new Run command that is a copy of this Run command with the --restart option applied.
      Run restartAlways()
      Create a new Run command that is a copy of this Run command with the --restart=always option applied.
      Run restartNo()
      Create a new Run command that is a copy of this Run command with the --restart=no option applied.
      Run restartOnFailure()
      Create a new Run command that is a copy of this Run command with the --restart=on-failure option applied.
      Run restartOnFailure​(int maxRetries)
      Create a new Run command that is a copy of this Run command with the --restart=on-failure:max-retries option applied.
      Run restartUnlessStopped()
      Create a new Run command that is a copy of this Run command with the --restart=unless-stopped option applied.
      Run rm()
      Create a new Run command that is a copy of this Run command with the --rm option applied.
      Run securityOptions​(Object... options)
      Create a new Run command that is a copy of this Run command with the --security-opt option applied.
      Run shmSize​(Object... values)
      Create a new Run command that is a copy of this Run command with the --shm-size option applied.
      Run signalProxy​(boolean enabled)
      Create a new Run command that is a copy of this Run command with the --sig-proxy option applied.
      Run stopSignal​(String signal)
      Create a new Run command that is a copy of this Run command with the --stop-signal option applied.
      Run tty()
      Create a new Run command that is a copy of this Run command with the --tty option applied.
      Run ulimit​(Object... options)
      Create a new Run command that is a copy of this Run command with the --ulimit option applied.
      Run user​(String username)
      Create a new Run command that is a copy of this Run command with the --user option applied.
      Run userNamespace​(String namespace)
      Create a new Run command that is a copy of this Run command with the --userns option applied.
      Run utsNamespace​(Object... options)
      Create a new Run command that is a copy of this Run command with the --ulimit option applied.
      Run volume​(Object... volumes)
      Create a new Run command that is a copy of this Run command with the --volume option applied.
      Run volumeDriver​(String name)
      Create a new Run command that is a copy of this Run command with the --volume-driver option applied.
      Run volumesFrom​(String... containers)
      Create a new Run command that is a copy of this Run command with the --volumes-from option applied.
      Run withCommandArguments​(com.oracle.bedrock.runtime.options.Argument... args)
      Obtain a copy of this AbstractDockerCommand with the addition of the specified command arguments Arguments.
      Run withoutCommandArguments​(com.oracle.bedrock.runtime.options.Argument... args)
      Obtain a copy of this AbstractDockerCommand without the specified command arguments Arguments.
      Run workinDirectory​(File file)
      Create a new Run command that is a copy of this Run command with the --workdir option applied.
    • Method Detail

      • withCommandArguments

        public Run withCommandArguments​(com.oracle.bedrock.runtime.options.Argument... args)
        Description copied from class: AbstractDockerCommand
        Obtain a copy of this AbstractDockerCommand with the addition of the specified command arguments Arguments.

        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:
        withCommandArguments in class AbstractDockerCommand<Run>
        Parameters:
        args - the additional Arguments
        Returns:
        a copy of this AbstractDockerCommand with the addition of the specified Arguments
      • withoutCommandArguments

        public Run withoutCommandArguments​(com.oracle.bedrock.runtime.options.Argument... args)
        Description copied from class: AbstractDockerCommand
        Obtain a copy of this AbstractDockerCommand without the specified command arguments Arguments.

        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:
        withoutCommandArguments in class AbstractDockerCommand<Run>
        Parameters:
        args - the additional Arguments
        Returns:
        a copy of this AbstractDockerCommand without the specified Arguments
      • detached

        public Run detached()
        Create a new Run command that is a copy of this Run command with the option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --detach option applied
      • interactive

        public Run interactive()
        Create a new Run command that is a copy of this Run command with the --interactive option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --interactive option applied.
      • tty

        public Run tty()
        Create a new Run command that is a copy of this Run command with the --tty option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --tty option applied.
      • env

        public Run env​(String name)
        Create a new Run command that is a copy of this Run command with the --env option applied using the specified environment variable name.
        Parameters:
        name - the name
        Returns:
        a new Run command that is a copy of this Run command with the --env option applied.
      • env

        public Run env​(String name,
                       Object value)
        Create a new Run command that is a copy of this Run command with the --env option applied using the specified environment variable name and value.
        Parameters:
        name - the name
        value - the value
        Returns:
        a new Run command that is a copy of this Run command with the --env option applied.
      • env

        public Run env​(Properties variables)
        Create a new Run command that is a copy of this Run command with the --env option applied using the specified environment variable names and values from the specified Properties.
        Parameters:
        variables - the variables
        Returns:
        a new Run command that is a copy of this Run command with the --env option applied.
      • expose

        public Run expose​(Object... ports)
        Create a new Run command that is a copy of this Run command with the --expose option applied.
        Parameters:
        ports - one or more values that resolve to a port or port range to expose
        Returns:
        a new Run command that is a copy of this Run command with the --expose option applied.
      • publishAll

        public Run publishAll()
        Create a new Run command that is a copy of this Run command with the --publish-all option applied.

        This will publish (NAT) all of the exposed ports in the image to random ports on the Docker host.

        Returns:
        a new Run command that is a copy of this Run command with the --publish-all option applied.
      • publish

        public Run publish​(Object... portMappings)
        Create a new Run command that is a copy of this Run command with the --publish option applied.

        This will publish (NAT) the specified ports to ports on the Docker host depending on the format of the specific port mappings.

        Parameters:
        portMappings - one or more values that resolve to valid Docker port mappings.
        Returns:
        a new Run command that is a copy of this Run command with the --publish option applied.
      • publish

        public Run publish​(Collection<?> portMappings)
        Create a new Run command that is a copy of this Run command with the --publish option applied.

        This will publish (NAT) the specified ports to ports on the Docker host depending on the format of the specific port mappings.

        Parameters:
        portMappings - one or more values that resolve to valid Docker port mappings.
        Returns:
        a new Run command that is a copy of this Run command with the --publish option applied.
      • autoRemove

        public Run autoRemove()
        Create a new Run command that is a copy of this Run command with the --rm option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --rm option applied.
      • attach

        public Run attach()
        Create a new Run command that is a copy of this Run command with the --attach option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --attach option applied.
      • addHost

        public Run addHost​(Object... hostMappings)
        Create a new Run command that is a copy of this Run command with the --add-host option applied.
        Parameters:
        hostMappings - one or more values that resolve to host mappings of the form "host:ip"
        Returns:
        a new Run command that is a copy of this Run command with the --add-host option applied.
      • blockIOWeight

        public Run blockIOWeight​(int weight)
        Create a new Run command that is a copy of this Run command with the --blkio-weight option applied.
        Parameters:
        weight - The Block IO Weight (relative)
        Returns:
        a new Run command that is a copy of this Run command with the --blkio-weight option applied.
      • blockIOWeightDevice

        public Run blockIOWeightDevice​(int weight)
        Create a new Run command that is a copy of this Run command with the --blkio-weight-device option applied.
        Parameters:
        weight - one or more values that resolve to block IO weights (relative device weight, format: "DEVICE_NAME:WEIGHT")
        Returns:
        a new Run command that is a copy of this Run command with the --blkio-weight-device option applied.
      • cpuShares

        public Run cpuShares​(int weight)
        Create a new Run command that is a copy of this Run command with the --cpu-shares option applied.
        Parameters:
        weight - the CPU shares (relative weight)
        Returns:
        a new Run command that is a copy of this Run command with the --cpu-shares option applied.
      • addCapability

        public Run addCapability​(Object... capabilities)
        Create a new Run command that is a copy of this Run command with the --cap-add option applied.
        Parameters:
        capabilities - one or more values resolving to Linux capabilities to add
        Returns:
        a new Run command that is a copy of this Run command with the --cap-add option applied.
      • dropCapability

        public Run dropCapability​(Object... capabilities)
        Create a new Run command that is a copy of this Run command with the --cap-drop option applied.
        Parameters:
        capabilities - one or more values resolving to Linux capabilities to drop
        Returns:
        a new Run command that is a copy of this Run command with the --cap-drop option applied.
      • cgroupParent

        public Run cgroupParent​(String parent)
        Create a new Run command that is a copy of this Run command with the --cgroup-parent option applied.
        Parameters:
        parent - the parent cgroup for the container
        Returns:
        a new Run command that is a copy of this Run command with the --cgroup-parent option applied.
      • cidFile

        public Run cidFile​(File file)
        Create a new Run command that is a copy of this Run command with the --cidfile option applied.
        Parameters:
        file - the file to write the container ID to
        Returns:
        a new Run command that is a copy of this Run command with the --cidfile option applied.
      • cpuPeriod

        public Run cpuPeriod​(int value)
        Create a new Run command that is a copy of this Run command with the --cpu-period option applied.
        Parameters:
        value - Limit CPU CFS (Completely Fair Scheduler) period
        Returns:
        a new Run command that is a copy of this Run command with the --cpu-period option applied.
      • cpuQuota

        public Run cpuQuota​(int value)
        Create a new Run command that is a copy of this Run command with the --cpu-quota option applied.
        Parameters:
        value - Limit CPU CFS (Completely Fair Scheduler) quota
        Returns:
        a new Run command that is a copy of this Run command with the --cpu-quota option applied.
      • cpuSetCPUs

        public Run cpuSetCPUs​(String value)
        Create a new Run command that is a copy of this Run command with the --cpuset-cpus option applied.
        Parameters:
        value - the CPUs in which to allow execution (0-3, 0,1, etc)
        Returns:
        a new Run command that is a copy of this Run command with the --cpuset-cpus option applied.
      • cpuSetMems

        public Run cpuSetMems​(String value)
        Create a new Run command that is a copy of this Run command with the --cpuset-mems option applied.
        Parameters:
        value - the memory nodes (MEMs) in which to allow execution (0-3, 0,1, etc)
        Returns:
        a new Run command that is a copy of this Run command with the --cpuset-mems option applied.
      • detach

        public Run detach​(String name)
        Create a new Run command that is a copy of this Run command with the --detach option applied.
        Parameters:
        name - the name
        Returns:
        a new Run command that is a copy of this Run command with the --detach option applied.
      • detachKeys

        public Run detachKeys​(String keys)
        Create a new Run command that is a copy of this Run command with the --detach-keys option applied.
        Parameters:
        keys - the escape key sequence used to detach a container
        Returns:
        a new Run command that is a copy of this Run command with the --keys option applied.
      • device

        public Run device​(Object... names)
        Create a new Run command that is a copy of this Run command with the --device option applied.
        Parameters:
        names - one or more values that resolve to host device to add to the container
        Returns:
        a new Run command that is a copy of this Run command with the --device option applied.
      • deviceReadBytesPerSec

        public Run deviceReadBytesPerSec​(String... values)
        Create a new Run command that is a copy of this Run command with the --device-read-bps option applied.
        Parameters:
        values - the read rate (bytes per second) from a device (e.g., --device-read-bps=/dev/sda:1mb)
        Returns:
        a new Run command that is a copy of this Run command with the --device-read-bps option applied.
      • deviceReadIOPS

        public Run deviceReadIOPS​(String... values)
        Create a new Run command that is a copy of this Run command with the --device-read-iops option applied.
        Parameters:
        values - the read rate (IO per second) from a device (e.g., --device-read-iops=/dev/sda:1000)
        Returns:
        a new Run command that is a copy of this Run command with the --device-read-iops option applied.
      • deviceWriteBytesPerSec

        public Run deviceWriteBytesPerSec​(String... values)
        Create a new Run command that is a copy of this Run command with the --device-write-bps option applied.
        Parameters:
        values - the write rate (bytes per second) to a device (e.g., --device-write-bps=/dev/sda:1mb)
        Returns:
        a new Run command that is a copy of this Run command with the --device-write-bps option applied.
      • deviceWriteIOPS

        public Run deviceWriteIOPS​(String... values)
        Create a new Run command that is a copy of this Run command with the --device-write-iops option applied.
        Parameters:
        values - the write rate (IO per second) to a device (e.g., --device-write-bps=/dev/sda:1000)
        Returns:
        a new Run command that is a copy of this Run command with the --device-write-iops option applied.
      • disableContentTrust

        public Run disableContentTrust()
        Create a new Run command that is a copy of this Run command with the --disable-content-trust option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --disable-content-trust option applied.
      • enableContentTrust

        public Run enableContentTrust()
        Create a new Run command that is a copy of this Run command with the --disable-content-trust option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --disable-content-trust option applied.
      • dns

        public Run dns​(String... servers)
        Create a new Run command that is a copy of this Run command with the --dns option applied.
        Parameters:
        servers - the custome DNS servers to use
        Returns:
        a new Run command that is a copy of this Run command with the --dns option applied.
      • dnsOptions

        public Run dnsOptions​(String... options)
        Create a new Run command that is a copy of this Run command with the --dns-opt option applied.
        Parameters:
        options - the custom DNS options
        Returns:
        a new Run command that is a copy of this Run command with the --dns-opt option applied.
      • dnsSearch

        public Run dnsSearch​(String... domains)
        Create a new Run command that is a copy of this Run command with the --dns-search option applied.
        Parameters:
        domains - the custom DNS search domains
        Returns:
        a new Run command that is a copy of this Run command with the --dns-search option applied.
      • entryPoint

        public Run entryPoint​(String entrypoint)
        Create a new Run command that is a copy of this Run command with the --entrypoint option applied.
        Parameters:
        entrypoint - the value to use for the entry point
        Returns:
        a new Run command that is a copy of this Run command with the -- option applied.
      • envFile

        public Run envFile​(File file)
        Create a new Run command that is a copy of this Run command with the --env-file option applied.
        Parameters:
        file - the file to use to read environment variables
        Returns:
        a new Run command that is a copy of this Run command with the --env-file option applied.
      • groupAdd

        public Run groupAdd​(String... groups)
        Create a new Run command that is a copy of this Run command with the --group-add option applied.
        Parameters:
        groups - the names of additional groups to run as
        Returns:
        a new Run command that is a copy of this Run command with the --group-add option applied.
      • hostName

        public Run hostName​(String name)
        Create a new Run command that is a copy of this Run command with the --hostname option applied.
        Parameters:
        name - the host name to give the container
        Returns:
        a new Run command that is a copy of this Run command with the --hostname option applied.
      • ip

        public Run ip​(String address)
        Create a new Run command that is a copy of this Run command with the --ip option applied.
        Parameters:
        address - the IP4 address to give to the container (e.g. 172.30.100.104)
        Returns:
        a new Run command that is a copy of this Run command with the --ip option applied.
      • ip6

        public Run ip6​(String address)
        Create a new Run command that is a copy of this Run command with the --ip6 option applied.
        Parameters:
        address - the IP6 address to give to the container (e.g. 2001:db8::33)
        Returns:
        a new Run command that is a copy of this Run command with the --ip6 option applied.
      • ipc

        public Run ipc​(String namespace)
        Create a new Run command that is a copy of this Run command with the --ipc option applied.
        Parameters:
        namespace - the IPC namespace to use
        Returns:
        a new Run command that is a copy of this Run command with the --ipc option applied.
      • isolation

        public Run isolation​(String value)
        Create a new Run command that is a copy of this Run command with the --isolation option applied.
        Parameters:
        value - the container isolation technology to use
        Returns:
        a new Run command that is a copy of this Run command with the --isolation option applied.
      • kernalMemory

        public Run kernalMemory​(String limit)
        Create a new Run command that is a copy of this Run command with the --kernel-memory option applied.
        Parameters:
        limit - the kernel memory limit
        Returns:
        a new Run command that is a copy of this Run command with the --kernel-memory option applied.
      • labels

        public Run labels​(Object... values)
        Create a new Run command that is a copy of this Run command with the --label option applied.
        Parameters:
        values - one or more values resolving to labels to assign to the container
        Returns:
        a new Run command that is a copy of this Run command with the --label option applied.
      • labelFile

        public Run labelFile​(File... files)
        Create a new Run command that is a copy of this Run command with the --label-file option applied.
        Parameters:
        files - one or more files of label values to read
        Returns:
        a new Run command that is a copy of this Run command with the --label-file option applied.
      • link

        public Run link​(Object... containers)
        Create a new Run command that is a copy of this Run command with the --link option applied.
        Parameters:
        containers - one or more values resolving to the names of other containers to link to
        Returns:
        a new Run command that is a copy of this Run command with the --link option applied.
      • link

        public Run link​(List<?> containers)
        Create a new Run command that is a copy of this Run command with the --link option applied.
        Parameters:
        containers - one or more values resolving to the names of other containers to link to
        Returns:
        a new Run command that is a copy of this Run command with the --link option applied.
      • logDriver

        public Run logDriver​(String name)
        Create a new Run command that is a copy of this Run command with the --log-driver option applied.
        Parameters:
        name - the name of the logging driver to use
        Returns:
        a new Run command that is a copy of this Run command with the --log-driver option applied.
      • logOptions

        public Run logOptions​(Object... options)
        Create a new Run command that is a copy of this Run command with the --log-opt option applied.
        Parameters:
        options - one or more value resolving to options to supply to the log driver
        Returns:
        a new Run command that is a copy of this Run command with the --log-opt option applied.
      • macAddress

        public Run macAddress​(String address)
        Create a new Run command that is a copy of this Run command with the --mac-address option applied.
        Parameters:
        address - the MAC address to apply to the container
        Returns:
        a new Run command that is a copy of this Run command with the --mac-address option applied.
      • memory

        public Run memory​(String limit)
        Create a new Run command that is a copy of this Run command with the --memory option applied.
        Parameters:
        limit - the memory limit to apply to the container
        Returns:
        a new Run command that is a copy of this Run command with the --memory option applied.
      • memoryReservation

        public Run memoryReservation​(String limit)
        Create a new Run command that is a copy of this Run command with the --memory-reservation option applied.
        Parameters:
        limit - the memory soft limit limit to apply to the container
        Returns:
        a new Run command that is a copy of this Run command with the --memory-reservation option applied.
      • memorySwap

        public Run memorySwap​(int swap)
        Create a new Run command that is a copy of this Run command with the --memory-swap option applied.
        Parameters:
        swap - a positive integer equal to memory plus swap
        Returns:
        a new Run command that is a copy of this Run command with the --memory-swap option applied.
      • memorySwappiness

        public Run memorySwappiness​(int swap)
        Create a new Run command that is a copy of this Run command with the --memory-swappiness option applied.
        Parameters:
        swap - tue a containers swappiness behaviour
        Returns:
        a new Run command that is a copy of this Run command with the --memory-swappiness option applied.
      • netNone

        public Run netNone()
        Create a new Run command that is a copy of this Run command with the --net=none option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --net=none option applied.
      • netBridge

        public Run netBridge()
        Create a new Run command that is a copy of this Run command with the --net=bridge option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --net=bridge option applied.
      • netHost

        public Run netHost()
        Create a new Run command that is a copy of this Run command with the --net=host option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --net=host option applied.
      • netContainer

        public Run netContainer​(String container)
        Create a new Run command that is a copy of this Run command with the --net=container:id option applied.
        Parameters:
        container - the name of the container to reuse the network stack from
        Returns:
        a new Run command that is a copy of this Run command with the --new=container:id option applied.
      • net

        public Run net​(String name)
        Create a new Run command that is a copy of this Run command with the --net option applied.
        Parameters:
        name - the name of a network to connect to
        Returns:
        a new Run command that is a copy of this Run command with the -- option applied.
      • netAlias

        public Run netAlias​(String... aliases)
        Create a new Run command that is a copy of this Run command with the --net option applied.
        Parameters:
        aliases - the network scoped aliases to use
        Returns:
        a new Run command that is a copy of this Run command with the -- option applied.
      • oomKillDisabled

        public Run oomKillDisabled()
        Create a new Run command that is a copy of this Run command with the --oom-kill-disabled option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --oom-kill-disabled option applied.
      • oomScoreAdjust

        public Run oomScoreAdjust​(int score)
        Create a new Run command that is a copy of this Run command with the --oom-score-adj option applied.
        Parameters:
        score - the host's OOM preferences for containers (accepts -1000 to 1000)
        Returns:
        a new Run command that is a copy of this Run command with the --oom-score-adj option applied.
      • pid

        public Run pid​(String namespace)
        Create a new Run command that is a copy of this Run command with the --pid option applied.
        Parameters:
        namespace - the PID namespace to use
        Returns:
        a new Run command that is a copy of this Run command with the --pid option applied.
      • pidsLimit

        public Run pidsLimit​(int limit)
        Create a new Run command that is a copy of this Run command with the --pids-limit option applied.
        Parameters:
        limit - the container pids limit (set -1 for unlimited)
        Returns:
        a new Run command that is a copy of this Run command with the --pids-limit option applied.
      • privileged

        public Run privileged​(int limit)
        Create a new Run command that is a copy of this Run command with the --privileged option applied.
        Parameters:
        limit - the limit
        Returns:
        a new Run command that is a copy of this Run command with the --privileged option applied.
      • readOnly

        public Run readOnly()
        Create a new Run command that is a copy of this Run command with the --read-only option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --read-only option applied.
      • restartAlways

        public Run restartAlways()
        Create a new Run command that is a copy of this Run command with the --restart=always option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --restart=always option applied.
      • restartNo

        public Run restartNo()
        Create a new Run command that is a copy of this Run command with the --restart=no option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --restart=no option applied.
      • restartOnFailure

        public Run restartOnFailure()
        Create a new Run command that is a copy of this Run command with the --restart=on-failure option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --restart=on-failure option applied.
      • restartOnFailure

        public Run restartOnFailure​(int maxRetries)
        Create a new Run command that is a copy of this Run command with the --restart=on-failure:max-retries option applied.
        Parameters:
        maxRetries - the maximum number of attempts to restart the container
        Returns:
        a new Run command that is a copy of this Run command with the --restart=on-failure:max-retries option applied.
      • restartUnlessStopped

        public Run restartUnlessStopped()
        Create a new Run command that is a copy of this Run command with the --restart=unless-stopped option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --restart=unless-stopped option applied.
      • restart

        public Run restart​(String policy)
        Create a new Run command that is a copy of this Run command with the --restart option applied.
        Parameters:
        policy - the container restart policy
        Returns:
        a new Run command that is a copy of this Run command with the --restart option applied.
      • rm

        public Run rm()
        Create a new Run command that is a copy of this Run command with the --rm option applied.
        Returns:
        a new Run command that is a copy of this Run command with the --rm option applied.
      • shmSize

        public Run shmSize​(Object... values)
        Create a new Run command that is a copy of this Run command with the --shm-size option 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`.

        Parameters:
        values - one or more values resolving to sizes of of `/dev/shm`.
        Returns:
        a new Run command that is a copy of this Run command with the --shm-size option applied.
      • securityOptions

        public Run securityOptions​(Object... options)
        Create a new Run command that is a copy of this Run command with the --security-opt option applied.
        Parameters:
        options - one or more values that resolves to a security option
        Returns:
        a new Run command that is a copy of this Run command with the --security-opt option applied.
      • signalProxy

        public Run signalProxy​(boolean enabled)
        Create a new Run command that is a copy of this Run command with the --sig-proxy option applied.
        Parameters:
        enabled - true to proxy received signals to the container
        Returns:
        a new Run command that is a copy of this Run command with the --sig-proxy option applied.
      • stopSignal

        public Run stopSignal​(String signal)
        Create a new Run command that is a copy of this Run command with the --stop-signal option applied.
        Parameters:
        signal - the signal to use to stop the container
        Returns:
        a new Run command that is a copy of this Run command with the --stop-signal option applied.
      • user

        public Run user​(String username)
        Create a new Run command that is a copy of this Run command with the --user option applied.
        Parameters:
        username - the username or UID to use (format: <name|uid>[:<group|gid>])
        Returns:
        a new Run command that is a copy of this Run command with the --user option applied.
      • userNamespace

        public Run userNamespace​(String namespace)
        Create a new Run command that is a copy of this Run command with the --userns option applied.
        Parameters:
        namespace - the container user namesapce
        Returns:
        a new Run command that is a copy of this Run command with the --userns option applied.
      • ulimit

        public Run ulimit​(Object... options)
        Create a new Run command that is a copy of this Run command with the --ulimit option applied.
        Parameters:
        options - the Ulimit options
        Returns:
        a new Run command that is a copy of this Run command with the --ulimit option applied.
      • utsNamespace

        public Run utsNamespace​(Object... options)
        Create a new Run command that is a copy of this Run command with the --ulimit option applied.
        Parameters:
        options - the Ulimit options
        Returns:
        a new Run command that is a copy of this Run command with the --ulimit option applied.
      • volume

        public Run volume​(Object... volumes)
        Create a new Run command that is a copy of this Run command with the --volume option applied.

        Bind mount a volume. The comma-delimited "options" are [rw|ro], [z|Z], [[r]shared|[r]slave|[r]private], and [nocopy]. The 'host-src' is an absolute path or a name value.

        Parameters:
        volumes - one or more values resolving to volumes to mount in the format [host-src:]container-dest[:options]
        Returns:
        a new Run command that is a copy of this Run command with the --volume option applied.
      • volumeDriver

        public Run volumeDriver​(String name)
        Create a new Run command that is a copy of this Run command with the --volume-driver option applied.
        Parameters:
        name - the name of the volume driver to use
        Returns:
        a new Run command that is a copy of this Run command with the --volume-driver option applied.
      • volumesFrom

        public Run volumesFrom​(String... containers)
        Create a new Run command that is a copy of this Run command with the --volumes-from option applied.
        Parameters:
        containers - the containers to mount volumes from
        Returns:
        a new Run command that is a copy of this Run command with the --volumes-from option applied.
      • workinDirectory

        public Run workinDirectory​(File file)
        Create a new Run command that is a copy of this Run command with the --workdir option applied.
        Parameters:
        file - the container working directory
        Returns:
        a new Run command that is a copy of this Run command with the --workdir option applied.
      • onLaunch

        public void onLaunch​(com.oracle.bedrock.runtime.Platform platform,
                             com.oracle.bedrock.OptionsByType optionsByType)
        Specified by:
        onLaunch in interface com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
        Overrides:
        onLaunch in class AbstractDockerCommand<Run>
      • onLaunched

        public void onLaunched​(com.oracle.bedrock.runtime.Platform platform,
                               com.oracle.bedrock.runtime.Application application,
                               com.oracle.bedrock.OptionsByType optionsByType)
        Specified by:
        onLaunched in interface com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
        Overrides:
        onLaunched in class AbstractDockerCommand<Run>
      • image

        public static Run image​(String image)
        Create a Run command 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 Run command to run a container from the specified image name
      • image

        public static Run image​(String image,
                                Object containerName)
        Create a Run command to run a container from the specified image name.
        Parameters:
        image - the image name
        containerName - a value that will resolve to a unique container name
        Returns:
        a Run command to run a container from the specified image name
      • image

        public static Run image​(DockerImage image)
        Create a Run command to run a container from the specified DockerImage name.

        The resulting container will be given a random name.

        Parameters:
        image - the DockerImage representing the image to use
        Returns:
        a Run command to run a container from the specified image name
      • image

        public static Run image​(DockerImage image,
                                Object containerName)
        Create a Run command to run a container from the specified image name.
        Parameters:
        image - the name of the image
        containerName - a value that will resolve to a unique container name
        Returns:
        a Run command to run a container from the specified image