com.github.dockerjava.api.command
Interface StartContainerCmd

All Superinterfaces:
DockerCmd<Void>
All Known Implementing Classes:
StartContainerCmdImpl

public interface StartContainerCmd
extends DockerCmd<Void>

Start a container


Nested Class Summary
static interface StartContainerCmd.Exec
           
 
Method Summary
 Void exec()
           
 Bind[] getBinds()
           
 String[] getCapAdd()
           
 String[] getCapDrop()
           
 String getContainerId()
           
 Device[] getDevices()
           
 String[] getDns()
           
 String[] getDnsSearch()
           
 Link[] getLinks()
           
 LxcConf[] getLxcConf()
           
 String getNetworkMode()
           
 Ports getPortBindings()
           
 RestartPolicy getRestartPolicy()
           
 String getVolumesFrom()
           
 boolean isPrivileged()
           
 boolean isPublishAllPorts()
           
 StartContainerCmd withBinds(Bind... binds)
           
 StartContainerCmd withCapAdd(String... capAdd)
          Add linux kernel capability to the container.
 StartContainerCmd withCapDrop(String... capDrop)
          Drop linux kernel capability from the container.
 StartContainerCmd withContainerId(String containerId)
           
 StartContainerCmd withDevices(Device... devices)
          Add host devices to the container
 StartContainerCmd withDns(String... dns)
          Set custom DNS servers
 StartContainerCmd withDnsSearch(String... dnsSearch)
          Set custom DNS search domains
 StartContainerCmd withLinks(Link... links)
          Add link to another container.
 StartContainerCmd withLxcConf(LxcConf... lxcConf)
           
 StartContainerCmd withNetworkMode(String networkMode)
          Set the Network mode for the container 'bridge': creates a new network stack for the container on the docker bridge 'none': no networking for this container 'container:': reuses another container network stack 'host': use the host network stack inside the container.
 StartContainerCmd withPortBindings(Ports portBindings)
           
 StartContainerCmd withPrivileged(boolean privileged)
           
 StartContainerCmd withPublishAllPorts(boolean publishAllPorts)
           
 StartContainerCmd withRestartPolicy(RestartPolicy restartPolicy)
          Set custom RestartPolicy for the container.
 StartContainerCmd withVolumesFrom(String volumesFrom)
           
 

Method Detail

getBinds

Bind[] getBinds()

getLinks

Link[] getLinks()

getLxcConf

LxcConf[] getLxcConf()

getPortBindings

Ports getPortBindings()

isPublishAllPorts

boolean isPublishAllPorts()

isPrivileged

boolean isPrivileged()

getDns

String[] getDns()

getDnsSearch

String[] getDnsSearch()

getVolumesFrom

String getVolumesFrom()

getContainerId

String getContainerId()

getNetworkMode

String getNetworkMode()

getDevices

Device[] getDevices()

getRestartPolicy

RestartPolicy getRestartPolicy()

getCapAdd

String[] getCapAdd()

getCapDrop

String[] getCapDrop()

withBinds

StartContainerCmd withBinds(Bind... binds)

withLinks

StartContainerCmd withLinks(Link... links)
Add link to another container.


withLxcConf

StartContainerCmd withLxcConf(LxcConf... lxcConf)

withPortBindings

StartContainerCmd withPortBindings(Ports portBindings)

withPrivileged

StartContainerCmd withPrivileged(boolean privileged)

withPublishAllPorts

StartContainerCmd withPublishAllPorts(boolean publishAllPorts)

withDns

StartContainerCmd withDns(String... dns)
Set custom DNS servers


withDnsSearch

StartContainerCmd withDnsSearch(String... dnsSearch)
Set custom DNS search domains


withVolumesFrom

StartContainerCmd withVolumesFrom(String volumesFrom)

withContainerId

StartContainerCmd withContainerId(String containerId)

withNetworkMode

StartContainerCmd withNetworkMode(String networkMode)
Set the Network mode for the container


withDevices

StartContainerCmd withDevices(Device... devices)
Add host devices to the container


withRestartPolicy

StartContainerCmd withRestartPolicy(RestartPolicy restartPolicy)
Set custom RestartPolicy for the container. Defaults to RestartPolicy.noRestart()


withCapAdd

StartContainerCmd withCapAdd(String... capAdd)
Add linux kernel capability to the container. For example: adding capability "MKNOD" allows the container to create special files using the 'mknod' command.


withCapDrop

StartContainerCmd withCapDrop(String... capDrop)
Drop linux kernel capability from the container. For example: dropping capability "CHOWN" prevents the container from changing the owner of any files.


exec

Void exec()
          throws NotFoundException,
                 NotModifiedException
Specified by:
exec in interface DockerCmd<Void>
Throws:
NotFoundException - No such container
NotModifiedException - Container already started


Copyright © 2014. All rights reserved.