com.github.dockerjava.core.command
Class StartContainerCmdImpl

java.lang.Object
  extended by com.github.dockerjava.core.command.AbstrDockerCmd<StartContainerCmd,Void>
      extended by com.github.dockerjava.core.command.StartContainerCmdImpl
All Implemented Interfaces:
DockerCmd<Void>, StartContainerCmd

public class StartContainerCmdImpl
extends AbstrDockerCmd<StartContainerCmd,Void>
implements StartContainerCmd

Start a container


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.github.dockerjava.api.command.StartContainerCmd
StartContainerCmd.Exec
 
Field Summary
 
Fields inherited from class com.github.dockerjava.core.command.AbstrDockerCmd
execution
 
Constructor Summary
StartContainerCmdImpl(StartContainerCmd.Exec exec, String containerId)
           
 
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()
           
 String toString()
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StartContainerCmdImpl

public StartContainerCmdImpl(StartContainerCmd.Exec exec,
                             String containerId)
Method Detail

getBinds

public Bind[] getBinds()
Specified by:
getBinds in interface StartContainerCmd

getLinks

public Link[] getLinks()
Specified by:
getLinks in interface StartContainerCmd

getLxcConf

public LxcConf[] getLxcConf()
Specified by:
getLxcConf in interface StartContainerCmd

getPortBindings

public Ports getPortBindings()
Specified by:
getPortBindings in interface StartContainerCmd

isPublishAllPorts

public boolean isPublishAllPorts()
Specified by:
isPublishAllPorts in interface StartContainerCmd

isPrivileged

public boolean isPrivileged()
Specified by:
isPrivileged in interface StartContainerCmd

getDns

public String[] getDns()
Specified by:
getDns in interface StartContainerCmd

getDnsSearch

public String[] getDnsSearch()
Specified by:
getDnsSearch in interface StartContainerCmd

getVolumesFrom

public String getVolumesFrom()
Specified by:
getVolumesFrom in interface StartContainerCmd

getContainerId

public String getContainerId()
Specified by:
getContainerId in interface StartContainerCmd

getNetworkMode

public String getNetworkMode()
Specified by:
getNetworkMode in interface StartContainerCmd

getDevices

public Device[] getDevices()
Specified by:
getDevices in interface StartContainerCmd

getRestartPolicy

public RestartPolicy getRestartPolicy()
Specified by:
getRestartPolicy in interface StartContainerCmd

getCapAdd

public String[] getCapAdd()
Specified by:
getCapAdd in interface StartContainerCmd

getCapDrop

public String[] getCapDrop()
Specified by:
getCapDrop in interface StartContainerCmd

withBinds

public StartContainerCmd withBinds(Bind... binds)
Specified by:
withBinds in interface StartContainerCmd

withLinks

public StartContainerCmd withLinks(Link... links)
Description copied from interface: StartContainerCmd
Add link to another container.

Specified by:
withLinks in interface StartContainerCmd

withLxcConf

public StartContainerCmd withLxcConf(LxcConf... lxcConf)
Specified by:
withLxcConf in interface StartContainerCmd

withPortBindings

public StartContainerCmd withPortBindings(Ports portBindings)
Specified by:
withPortBindings in interface StartContainerCmd

withPrivileged

public StartContainerCmd withPrivileged(boolean privileged)
Specified by:
withPrivileged in interface StartContainerCmd

withPublishAllPorts

public StartContainerCmd withPublishAllPorts(boolean publishAllPorts)
Specified by:
withPublishAllPorts in interface StartContainerCmd

withDns

public StartContainerCmd withDns(String... dns)
Description copied from interface: StartContainerCmd
Set custom DNS servers

Specified by:
withDns in interface StartContainerCmd

withDnsSearch

public StartContainerCmd withDnsSearch(String... dnsSearch)
Description copied from interface: StartContainerCmd
Set custom DNS search domains

Specified by:
withDnsSearch in interface StartContainerCmd

withVolumesFrom

public StartContainerCmd withVolumesFrom(String volumesFrom)
Specified by:
withVolumesFrom in interface StartContainerCmd

withContainerId

public StartContainerCmd withContainerId(String containerId)
Specified by:
withContainerId in interface StartContainerCmd

withNetworkMode

public StartContainerCmd withNetworkMode(String networkMode)
Description copied from interface: StartContainerCmd
Set the Network mode for the container

Specified by:
withNetworkMode in interface StartContainerCmd

withDevices

public StartContainerCmd withDevices(Device... devices)
Description copied from interface: StartContainerCmd
Add host devices to the container

Specified by:
withDevices in interface StartContainerCmd

withRestartPolicy

public StartContainerCmd withRestartPolicy(RestartPolicy restartPolicy)
Description copied from interface: StartContainerCmd
Set custom RestartPolicy for the container. Defaults to RestartPolicy.noRestart()

Specified by:
withRestartPolicy in interface StartContainerCmd

withCapAdd

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

Specified by:
withCapAdd in interface StartContainerCmd

withCapDrop

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

Specified by:
withCapDrop in interface StartContainerCmd

toString

public String toString()
Overrides:
toString in class Object

exec

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


Copyright © 2014. All rights reserved.