com.github.dockerjava.core.command
Class CreateContainerCmdImpl

java.lang.Object
  extended by com.github.dockerjava.core.command.AbstrDockerCmd<CreateContainerCmd,CreateContainerResponse>
      extended by com.github.dockerjava.core.command.CreateContainerCmdImpl
All Implemented Interfaces:
CreateContainerCmd, DockerCmd<CreateContainerResponse>

public class CreateContainerCmdImpl
extends AbstrDockerCmd<CreateContainerCmd,CreateContainerResponse>
implements CreateContainerCmd

Creates a new container.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.github.dockerjava.api.command.CreateContainerCmd
CreateContainerCmd.Exec
 
Field Summary
 
Fields inherited from class com.github.dockerjava.core.command.AbstrDockerCmd
execution
 
Constructor Summary
CreateContainerCmdImpl(CreateContainerCmd.Exec exec, String image)
           
 
Method Summary
 CreateContainerResponse exec()
           
 String[] getCmd()
           
 String[] getDns()
           
 String[] getEnv()
           
 ExposedPort[] getExposedPorts()
           
 String getHostName()
           
 String getImage()
           
 long getMemoryLimit()
           
 long getMemorySwap()
           
 String getName()
           
 String[] getPortSpecs()
           
 String getUser()
           
 Volume[] getVolumes()
           
 String[] getVolumesFrom()
           
 String getWorkingDir()
           
 boolean isAttachStderr()
           
 boolean isAttachStdin()
           
 boolean isAttachStdout()
           
 boolean isDisableNetwork()
           
 boolean isStdInOnce()
           
 boolean isStdinOpen()
           
 boolean isTty()
           
 String toString()
           
 CreateContainerCmdImpl withAttachStderr(boolean attachStderr)
           
 CreateContainerCmdImpl withAttachStdin(boolean attachStdin)
           
 CreateContainerCmdImpl withAttachStdout(boolean attachStdout)
           
 CreateContainerCmdImpl withCmd(String... cmd)
           
 CreateContainerCmdImpl withDisableNetwork(boolean disableNetwork)
           
 CreateContainerCmdImpl withDns(String... dns)
           
 CreateContainerCmdImpl withEnv(String... env)
           
 CreateContainerCmdImpl withExposedPorts(ExposedPort... exposedPorts)
           
 CreateContainerCmdImpl withHostName(String hostName)
           
 CreateContainerCmdImpl withImage(String image)
           
 CreateContainerCmdImpl withMemoryLimit(long memoryLimit)
           
 CreateContainerCmdImpl withMemorySwap(long memorySwap)
           
 CreateContainerCmdImpl withName(String name)
           
 CreateContainerCmdImpl withPortSpecs(String... portSpecs)
           
 CreateContainerCmdImpl withStdInOnce(boolean stdInOnce)
           
 CreateContainerCmdImpl withStdinOpen(boolean stdinOpen)
           
 CreateContainerCmdImpl withTty(boolean tty)
           
 CreateContainerCmdImpl withUser(String user)
           
 CreateContainerCmdImpl withVolumes(Volume... volumes)
           
 CreateContainerCmdImpl withVolumesFrom(String... volumesFrom)
           
 CreateContainerCmdImpl withWorkingDir(String workingDir)
           
 
Methods inherited from class com.github.dockerjava.core.command.AbstrDockerCmd
toDockerException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateContainerCmdImpl

public CreateContainerCmdImpl(CreateContainerCmd.Exec exec,
                              String image)
Method Detail

withName

public CreateContainerCmdImpl withName(String name)
Specified by:
withName in interface CreateContainerCmd

getName

public String getName()
Specified by:
getName in interface CreateContainerCmd

withExposedPorts

public CreateContainerCmdImpl withExposedPorts(ExposedPort... exposedPorts)
Specified by:
withExposedPorts in interface CreateContainerCmd

getExposedPorts

public ExposedPort[] getExposedPorts()
Specified by:
getExposedPorts in interface CreateContainerCmd

isDisableNetwork

public boolean isDisableNetwork()
Specified by:
isDisableNetwork in interface CreateContainerCmd

getWorkingDir

public String getWorkingDir()
Specified by:
getWorkingDir in interface CreateContainerCmd

withWorkingDir

public CreateContainerCmdImpl withWorkingDir(String workingDir)
Specified by:
withWorkingDir in interface CreateContainerCmd

getHostName

public String getHostName()
Specified by:
getHostName in interface CreateContainerCmd

withDisableNetwork

public CreateContainerCmdImpl withDisableNetwork(boolean disableNetwork)
Specified by:
withDisableNetwork in interface CreateContainerCmd

withHostName

public CreateContainerCmdImpl withHostName(String hostName)
Specified by:
withHostName in interface CreateContainerCmd

getPortSpecs

public String[] getPortSpecs()
Specified by:
getPortSpecs in interface CreateContainerCmd

withPortSpecs

public CreateContainerCmdImpl withPortSpecs(String... portSpecs)
Specified by:
withPortSpecs in interface CreateContainerCmd

getUser

public String getUser()
Specified by:
getUser in interface CreateContainerCmd

withUser

public CreateContainerCmdImpl withUser(String user)
Specified by:
withUser in interface CreateContainerCmd

isTty

public boolean isTty()
Specified by:
isTty in interface CreateContainerCmd

withTty

public CreateContainerCmdImpl withTty(boolean tty)
Specified by:
withTty in interface CreateContainerCmd

isStdinOpen

public boolean isStdinOpen()
Specified by:
isStdinOpen in interface CreateContainerCmd

withStdinOpen

public CreateContainerCmdImpl withStdinOpen(boolean stdinOpen)
Specified by:
withStdinOpen in interface CreateContainerCmd

isStdInOnce

public boolean isStdInOnce()
Specified by:
isStdInOnce in interface CreateContainerCmd

withStdInOnce

public CreateContainerCmdImpl withStdInOnce(boolean stdInOnce)
Specified by:
withStdInOnce in interface CreateContainerCmd

getMemoryLimit

public long getMemoryLimit()
Specified by:
getMemoryLimit in interface CreateContainerCmd

withMemoryLimit

public CreateContainerCmdImpl withMemoryLimit(long memoryLimit)
Specified by:
withMemoryLimit in interface CreateContainerCmd

getMemorySwap

public long getMemorySwap()
Specified by:
getMemorySwap in interface CreateContainerCmd

withMemorySwap

public CreateContainerCmdImpl withMemorySwap(long memorySwap)
Specified by:
withMemorySwap in interface CreateContainerCmd

isAttachStdin

public boolean isAttachStdin()
Specified by:
isAttachStdin in interface CreateContainerCmd

withAttachStdin

public CreateContainerCmdImpl withAttachStdin(boolean attachStdin)
Specified by:
withAttachStdin in interface CreateContainerCmd

isAttachStdout

public boolean isAttachStdout()
Specified by:
isAttachStdout in interface CreateContainerCmd

withAttachStdout

public CreateContainerCmdImpl withAttachStdout(boolean attachStdout)
Specified by:
withAttachStdout in interface CreateContainerCmd

isAttachStderr

public boolean isAttachStderr()
Specified by:
isAttachStderr in interface CreateContainerCmd

withAttachStderr

public CreateContainerCmdImpl withAttachStderr(boolean attachStderr)
Specified by:
withAttachStderr in interface CreateContainerCmd

getEnv

public String[] getEnv()
Specified by:
getEnv in interface CreateContainerCmd

withEnv

public CreateContainerCmdImpl withEnv(String... env)
Specified by:
withEnv in interface CreateContainerCmd

getCmd

public String[] getCmd()
Specified by:
getCmd in interface CreateContainerCmd

withCmd

public CreateContainerCmdImpl withCmd(String... cmd)
Specified by:
withCmd in interface CreateContainerCmd

getDns

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

withDns

public CreateContainerCmdImpl withDns(String... dns)
Specified by:
withDns in interface CreateContainerCmd

getImage

public String getImage()
Specified by:
getImage in interface CreateContainerCmd

withImage

public CreateContainerCmdImpl withImage(String image)
Specified by:
withImage in interface CreateContainerCmd

getVolumes

public Volume[] getVolumes()
Specified by:
getVolumes in interface CreateContainerCmd

withVolumes

public CreateContainerCmdImpl withVolumes(Volume... volumes)
Specified by:
withVolumes in interface CreateContainerCmd

getVolumesFrom

public String[] getVolumesFrom()
Specified by:
getVolumesFrom in interface CreateContainerCmd

withVolumesFrom

public CreateContainerCmdImpl withVolumesFrom(String... volumesFrom)
Specified by:
withVolumesFrom in interface CreateContainerCmd

toString

public String toString()
Overrides:
toString in class Object

exec

public CreateContainerResponse exec()
                             throws NotFoundException,
                                    ConflictException
Specified by:
exec in interface CreateContainerCmd
Specified by:
exec in interface DockerCmd<CreateContainerResponse>
Overrides:
exec in class AbstrDockerCmd<CreateContainerCmd,CreateContainerResponse>
Throws:
NotFoundException - No such container
ConflictException - Named container already exists


Copyright © 2014. All rights reserved.