com.github.dockerjava.core.command
Class CreateContainerCmdImpl
java.lang.Object
com.github.dockerjava.core.command.AbstrDockerCmd<CreateContainerCmd,CreateContainerResponse>
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.
CreateContainerCmdImpl
public CreateContainerCmdImpl(CreateContainerCmd.Exec exec,
String image)
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.