com.fitbur.github.dockerjava.api.command.CreateContainerCmd Maven / Gradle / Ivy
package com.fitbur.github.dockerjava.api.com.fitburmand;
import java.util.Map;
import com.fitbur.github.dockerjava.api.ConflictException;
import com.fitbur.github.dockerjava.api.NotFoundException;
import com.fitbur.github.dockerjava.api.model.Bind;
import com.fitbur.github.dockerjava.api.model.Capability;
import com.fitbur.github.dockerjava.api.model.Device;
import com.fitbur.github.dockerjava.api.model.ExposedPort;
import com.fitbur.github.dockerjava.api.model.Link;
import com.fitbur.github.dockerjava.api.model.LogConfig;
import com.fitbur.github.dockerjava.api.model.LxcConf;
import com.fitbur.github.dockerjava.api.model.PortBinding;
import com.fitbur.github.dockerjava.api.model.Ports;
import com.fitbur.github.dockerjava.api.model.RestartPolicy;
import com.fitbur.github.dockerjava.api.model.Ulimit;
import com.fitbur.github.dockerjava.api.model.Volume;
import com.fitbur.github.dockerjava.api.model.VolumesFrom;
import javax.annotation.CheckForNull;
public interface CreateContainerCmd extends SyncDockerCmd {
public static interface Exec extends DockerCmdSyncExec {
}
/**
* @throws NotFoundException
* No such container
* @throws ConflictException
* Named container already exists
*/
@Override
public CreateContainerResponse exec() throws NotFoundException, ConflictException;
public Bind[] getBinds();
public Capability[] getCapAdd();
public Capability[] getCapDrop();
public String[] getCmd();
public String getCpuset();
public int getCpuShares();
/**
* @since 1.19
*/
public Integer getCpuPeriod();
/**
* @since 1.19
*/
public String getCpusetMems();
/**
* @since 1.19
*/
public Integer getBlkioWeight();
/**
* @since 1.19
*/
public Boolean isOomKillDisable();
public Device[] getDevices();
public String[] getDns();
public String[] getDnsSearch();
public String[] getEntrypoint();
public String[] getEnv();
public ExposedPort[] getExposedPorts();
public String[] getExtraHosts();
public String getHostName();
public String getDomainName();
public String getImage();
public Link[] getLinks();
public LxcConf[] getLxcConf();
public LogConfig getLogConfig();
public String getMacAddress();
public long getMemoryLimit();
public long getMemorySwap();
public String getName();
public String getNetworkMode();
public Ports getPortBindings();
public String[] getPortSpecs();
public RestartPolicy getRestartPolicy();
public String getUser();
public Volume[] getVolumes();
public VolumesFrom[] getVolumesFrom();
public String getWorkingDir();
public Ulimit[] getUlimits();
public boolean isAttachStderr();
public boolean isAttachStdin();
public boolean isAttachStdout();
public boolean isNetworkDisabled();
public Boolean isPrivileged();
public Boolean isPublishAllPorts();
public boolean isStdInOnce();
public boolean isStdinOpen();
public boolean isTty();
@CheckForNull
public String getPidMode();
public CreateContainerCmd withAttachStderr(boolean attachStderr);
public CreateContainerCmd withAttachStdin(boolean attachStdin);
public CreateContainerCmd withAttachStdout(boolean attachStdout);
public CreateContainerCmd withBinds(Bind... binds);
/**
* Add linux kernel capability to the
* container. For example: adding {@link Capability#MKNOD} allows the container to create special files using the
* 'mknod' com.fitburmand.
*/
public CreateContainerCmd withCapAdd(Capability... capAdd);
/**
* Drop linux kernel capability from the
* container. For example: dropping {@link Capability#CHOWN} prevents the container from changing the owner of any
* files.
*/
public CreateContainerCmd withCapDrop(Capability... capDrop);
public CreateContainerCmd withCmd(String... cmd);
public CreateContainerCmd withCpuset(String cpuset);
public CreateContainerCmd withCpuShares(int cpuShares);
/**
* @since 1.19
*/
public CreateContainerCmd withCpuPeriod(Integer cpuPeriod);
/**
* @since 1.19
*/
public CreateContainerCmd withCpusetMems(String cpusetMems);
/**
* @since 1.19
*/
public CreateContainerCmd withBlkioWeight(Integer blkioWeight);
/**
* @since 1.19
*/
public CreateContainerCmd withOomKillDisable(Boolean oomKillDisable);
/**
* Add host com.fitburvices to the container
*/
public CreateContainerCmd withDevices(Device... com.fitburvices);
public CreateContainerCmd withNetworkDisabled(boolean disableNetwork);
/**
* Set custom DNS servers
*/
public CreateContainerCmd withDns(String... dns);
/**
* Set custom DNS search domains
*/
public CreateContainerCmd withDnsSearch(String... dnsSearch);
public CreateContainerCmd withEntrypoint(String... entrypoint);
public CreateContainerCmd withEnv(String... env);
public CreateContainerCmd withExposedPorts(ExposedPort... exposedPorts);
/**
* Add hostnames to /etc/hosts in the container
*/
public CreateContainerCmd withExtraHosts(String... extraHosts);
public CreateContainerCmd withHostName(String hostName);
public CreateContainerCmd withDomainName(String domainName);
public CreateContainerCmd withImage(String image);
public CreateContainerCmd withLabels(Map labels);
/**
* Add link to another container.
*/
public CreateContainerCmd withLinks(Link... links);
public CreateContainerCmd withLxcConf(LxcConf... lxcConf);
public CreateContainerCmd withLogConfig(LogConfig logConfig);
public CreateContainerCmd withMemoryLimit(long memoryLimit);
public CreateContainerCmd withMemorySwap(long memorySwap);
public CreateContainerCmd withName(String name);
/**
* 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. Note: the host mode gives the container full access
* to local system services such as D-bus and is therefore considered insecure.
*
*/
public CreateContainerCmd withNetworkMode(String networkMode);
/**
* Add one or more {@link PortBinding}s. This corresponds to the --publish
(-p
) option of
* the docker run
CLI com.fitburmand.
*/
public CreateContainerCmd withPortBindings(PortBinding... portBindings);
/**
* Add the port bindings that are contained in the given {@link Ports} object.
*
* @see #withPortBindings(PortBinding...)
*/
public CreateContainerCmd withPortBindings(Ports portBindings);
public CreateContainerCmd withPortSpecs(String... portSpecs);
public CreateContainerCmd withPrivileged(boolean privileged);
public CreateContainerCmd withPublishAllPorts(boolean publishAllPorts);
/**
* Set custom {@link RestartPolicy} for the container. Defaults to {@link RestartPolicy#noRestart()}
*/
public CreateContainerCmd withRestartPolicy(RestartPolicy restartPolicy);
public CreateContainerCmd withStdInOnce(boolean stdInOnce);
public CreateContainerCmd withStdinOpen(boolean stdinOpen);
public CreateContainerCmd withTty(boolean tty);
public CreateContainerCmd withUser(String user);
public CreateContainerCmd withVolumes(Volume... volumes);
public CreateContainerCmd withVolumesFrom(VolumesFrom... volumesFrom);
public CreateContainerCmd withWorkingDir(String workingDir);
public CreateContainerCmd withMacAddress(String macAddress);
public CreateContainerCmd withUlimits(Ulimit[] ulimits);
public CreateContainerCmd withReadonlyRootfs(boolean readonlyRootfs);
public CreateContainerCmd withContainerIDFile(String containerIDFile);
/**
* Set the PID (Process) Namespace mode for the container, 'host': use the host's PID namespace inside the container
*/
public CreateContainerCmd withPidMode(String pidMode);
/**
* @return
*/
Map getLabels();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy