Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@
import com.github.dockerjava.api.exception.ConflictException;
import com.github.dockerjava.api.exception.NotFoundException;
import com.github.dockerjava.api.model.AuthConfig;
import com.github.dockerjava.api.model.Bind;
import com.github.dockerjava.api.model.Capability;
import com.github.dockerjava.api.model.Device;
import com.github.dockerjava.api.model.ExposedPort;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.Link;
import com.github.dockerjava.api.model.LogConfig;
import com.github.dockerjava.api.model.LxcConf;
import com.github.dockerjava.api.model.PortBinding;
import com.github.dockerjava.api.model.Ports;
import com.github.dockerjava.api.model.RestartPolicy;
import com.github.dockerjava.api.model.Ulimit;
import com.github.dockerjava.api.model.Volume;
import com.github.dockerjava.api.model.VolumesFrom;

import javax.annotation.CheckForNull;
import java.util.List;
Expand All @@ -30,51 +19,9 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons
@CheckForNull
List<String> getAliases();

@CheckForNull
Bind[] getBinds();

/**
* @since 1.19
*/
@CheckForNull
Integer getBlkioWeight();

@CheckForNull
Capability[] getCapAdd();

@CheckForNull
Capability[] getCapDrop();

@CheckForNull
String[] getCmd();

/**
* @since 1.19
*/
@CheckForNull
Integer getCpuPeriod();

@CheckForNull
String getCpusetCpus();

/**
* @since 1.19
*/
@CheckForNull
String getCpusetMems();

@CheckForNull
Integer getCpuShares();

@CheckForNull
Device[] getDevices();

@CheckForNull
String[] getDns();

@CheckForNull
String[] getDnsSearch();

@CheckForNull
String getDomainName();

Expand All @@ -90,9 +37,6 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons
@CheckForNull
String getStopSignal();

@CheckForNull
String[] getExtraHosts();

@CheckForNull
String getHostName();

Expand All @@ -108,54 +52,21 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons
@CheckForNull
Map<String, String> getLabels();

@CheckForNull
Link[] getLinks();

@CheckForNull
LogConfig getLogConfig();

@CheckForNull
LxcConf[] getLxcConf();

@CheckForNull
String getMacAddress();

@CheckForNull
Long getMemory();

@CheckForNull
Long getMemorySwap();

@CheckForNull
Integer getMemorySwappiness();

@CheckForNull
String getName();

@CheckForNull
String getNetworkMode();

@CheckForNull
Ports getPortBindings();

@CheckForNull
String[] getPortSpecs();

@CheckForNull
RestartPolicy getRestartPolicy();

@CheckForNull
Ulimit[] getUlimits();

@CheckForNull
String getUser();

@CheckForNull
Volume[] getVolumes();

@CheckForNull
VolumesFrom[] getVolumesFrom();

@CheckForNull
String getWorkingDir();

Expand All @@ -171,36 +82,15 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons
@CheckForNull
Boolean isNetworkDisabled();

/**
* @since 1.19
*/
@CheckForNull
Boolean getOomKillDisable();

@CheckForNull
Boolean getPrivileged();

@CheckForNull
Boolean getPublishAllPorts();

@CheckForNull
Boolean getReadonlyRootfs();

@CheckForNull
Boolean isStdInOnce();

@CheckForNull
Boolean isStdinOpen();

@CheckForNull
String getPidMode();

@CheckForNull
HostConfig getHostConfig();

@CheckForNull
String getCgroupParent();

@CheckForNull
Boolean isTty();

Expand Down Expand Up @@ -230,89 +120,10 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons

CreateContainerCmd withAttachStdout(Boolean attachStdout);

CreateContainerCmd withBinds(Bind... binds);

CreateContainerCmd withBinds(List<Bind> binds);

/**
* @since 1.19
*/
CreateContainerCmd withBlkioWeight(Integer blkioWeight);

/**
* Add linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> to the container. For example:
* adding {@link Capability#MKNOD} allows the container to create special files using the 'mknod' command.
*/
CreateContainerCmd withCapAdd(Capability... capAdd);

/**
* Add linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> to the container. For example:
* adding {@link Capability#MKNOD} allows the container to create special files using the 'mknod' command.
*/
CreateContainerCmd withCapAdd(List<Capability> capAdd);

/**
* Drop linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> from the container. For example:
* dropping {@link Capability#CHOWN} prevents the container from changing the owner of any files.
*/
CreateContainerCmd withCapDrop(Capability... capDrop);

/**
* Drop linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> from the container. For example:
* dropping {@link Capability#CHOWN} prevents the container from changing the owner of any files.
*/
CreateContainerCmd withCapDrop(List<Capability> capDrop);

CreateContainerCmd withCmd(String... cmd);

CreateContainerCmd withCmd(List<String> cmd);

CreateContainerCmd withContainerIDFile(String containerIDFile);

/**
* @since 1.19
*/
CreateContainerCmd withCpuPeriod(Integer cpuPeriod);

CreateContainerCmd withCpusetCpus(String cpusetCpus);

/**
* @since 1.19
*/
CreateContainerCmd withCpusetMems(String cpusetMems);

CreateContainerCmd withCpuShares(Integer cpuShares);

/**
* Add host devices to the container
*/
CreateContainerCmd withDevices(Device... devices);

/**
* Add host devices to the container
*/
CreateContainerCmd withDevices(List<Device> devices);

/**
* Set custom DNS servers
*/
CreateContainerCmd withDns(String... dns);

/**
* Set custom DNS servers
*/
CreateContainerCmd withDns(List<String> dns);

/**
* Set custom DNS search domains
*/
CreateContainerCmd withDnsSearch(String... dnsSearch);

/**
* Set custom DNS search domains
*/
CreateContainerCmd withDnsSearch(List<String> dnsSearch);

CreateContainerCmd withDomainName(String domainName);

CreateContainerCmd withEntrypoint(String... entrypoint);
Expand All @@ -329,16 +140,6 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons

CreateContainerCmd withExposedPorts(List<ExposedPort> exposedPorts);

/**
* Add hostnames to /etc/hosts in the container
*/
CreateContainerCmd withExtraHosts(String... extraHosts);

/**
* Add hostnames to /etc/hosts in the container
*/
CreateContainerCmd withExtraHosts(List<String> extraHosts);

CreateContainerCmd withHostName(String hostName);

CreateContainerCmd withImage(String image);
Expand All @@ -349,114 +150,30 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons

CreateContainerCmd withLabels(Map<String, String> labels);

/**
* Add link to another container.
*/
CreateContainerCmd withLinks(Link... links);

/**
* Add link to another container.
*/
CreateContainerCmd withLinks(List<Link> links);

CreateContainerCmd withLogConfig(LogConfig logConfig);

CreateContainerCmd withLxcConf(LxcConf... lxcConf);

CreateContainerCmd withLxcConf(List<LxcConf> lxcConf);

CreateContainerCmd withMacAddress(String macAddress);

CreateContainerCmd withMemory(Long memory);

CreateContainerCmd withMemorySwap(Long memorySwap);

CreateContainerCmd withMemorySwappiness(Integer memorySwappiness);

CreateContainerCmd withName(String name);

CreateContainerCmd withNetworkDisabled(Boolean disableNetwork);

/**
* Set the Network mode for the container
* <ul>
* <li>'bridge': creates a new network stack for the container on the docker bridge</li>
* <li>'none': no networking for this container</li>
* <li>'container:<name|id>': reuses another container network stack</li>
* <li>'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.</li>
* </ul>
*/
CreateContainerCmd withNetworkMode(String networkMode);

/**
* @since 1.19
*/
CreateContainerCmd withOomKillDisable(Boolean oomKillDisable);

/**
* Add one or more {@link PortBinding}s. This corresponds to the <code>--publish</code> (<code>-p</code>) option of the
* <code>docker run</code> CLI command.
*/
CreateContainerCmd withPortBindings(PortBinding... portBindings);

/**
* Add one or more {@link PortBinding}s. This corresponds to the <code>--publish</code> (<code>-p</code>) option of the
* <code>docker run</code> CLI command.
*/
CreateContainerCmd withPortBindings(List<PortBinding> portBindings);

/**
* Add the port bindings that are contained in the given {@link Ports} object.
*
* @see #withPortBindings(PortBinding...)
*/
CreateContainerCmd withPortBindings(Ports portBindings);

CreateContainerCmd withPortSpecs(String... portSpecs);

CreateContainerCmd withPortSpecs(List<String> portSpecs);

CreateContainerCmd withPrivileged(Boolean privileged);

CreateContainerCmd withPublishAllPorts(Boolean publishAllPorts);

CreateContainerCmd withReadonlyRootfs(Boolean readonlyRootfs);

/**
* Set custom {@link RestartPolicy} for the container. Defaults to {@link RestartPolicy#noRestart()}
*/
CreateContainerCmd withRestartPolicy(RestartPolicy restartPolicy);

CreateContainerCmd withStdInOnce(Boolean stdInOnce);

CreateContainerCmd withStdinOpen(Boolean stdinOpen);

CreateContainerCmd withTty(Boolean tty);

CreateContainerCmd withUlimits(Ulimit... ulimits);

CreateContainerCmd withUlimits(List<Ulimit> ulimits);

CreateContainerCmd withUser(String user);

CreateContainerCmd withVolumes(Volume... volumes);

CreateContainerCmd withVolumes(List<Volume> volumes);

CreateContainerCmd withVolumesFrom(VolumesFrom... volumesFrom);

CreateContainerCmd withVolumesFrom(List<VolumesFrom> volumesFrom);

CreateContainerCmd withWorkingDir(String workingDir);

CreateContainerCmd withCgroupParent(String cgroupParent);

/**
* Set the PID (Process) Namespace mode for the container, 'host': use the host's PID namespace inside the container
*/
CreateContainerCmd withPidMode(String pidMode);

CreateContainerCmd withHostConfig(HostConfig hostConfig);

/**
Expand Down
Loading