Skip to content

Commit 580ea40

Browse files
committed
Stop proxying hostconfig calls.
1 parent 63b5065 commit 580ea40

File tree

3 files changed

+85
-748
lines changed

3 files changed

+85
-748
lines changed

src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java

-283
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@
33
import com.github.dockerjava.api.exception.ConflictException;
44
import com.github.dockerjava.api.exception.NotFoundException;
55
import com.github.dockerjava.api.model.AuthConfig;
6-
import com.github.dockerjava.api.model.Bind;
7-
import com.github.dockerjava.api.model.Capability;
8-
import com.github.dockerjava.api.model.Device;
96
import com.github.dockerjava.api.model.ExposedPort;
107
import com.github.dockerjava.api.model.HostConfig;
11-
import com.github.dockerjava.api.model.Link;
12-
import com.github.dockerjava.api.model.LogConfig;
13-
import com.github.dockerjava.api.model.LxcConf;
14-
import com.github.dockerjava.api.model.PortBinding;
15-
import com.github.dockerjava.api.model.Ports;
16-
import com.github.dockerjava.api.model.RestartPolicy;
17-
import com.github.dockerjava.api.model.Ulimit;
188
import com.github.dockerjava.api.model.Volume;
19-
import com.github.dockerjava.api.model.VolumesFrom;
209

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

33-
@CheckForNull
34-
Bind[] getBinds();
35-
36-
/**
37-
* @since 1.19
38-
*/
39-
@CheckForNull
40-
Integer getBlkioWeight();
41-
42-
@CheckForNull
43-
Capability[] getCapAdd();
44-
45-
@CheckForNull
46-
Capability[] getCapDrop();
47-
4822
@CheckForNull
4923
String[] getCmd();
5024

51-
/**
52-
* @since 1.19
53-
*/
54-
@CheckForNull
55-
Integer getCpuPeriod();
56-
57-
@CheckForNull
58-
String getCpusetCpus();
59-
60-
/**
61-
* @since 1.19
62-
*/
63-
@CheckForNull
64-
String getCpusetMems();
65-
66-
@CheckForNull
67-
Integer getCpuShares();
68-
69-
@CheckForNull
70-
Device[] getDevices();
71-
72-
@CheckForNull
73-
String[] getDns();
74-
75-
@CheckForNull
76-
String[] getDnsSearch();
77-
7825
@CheckForNull
7926
String getDomainName();
8027

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

93-
@CheckForNull
94-
String[] getExtraHosts();
95-
9640
@CheckForNull
9741
String getHostName();
9842

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

111-
@CheckForNull
112-
Link[] getLinks();
113-
114-
@CheckForNull
115-
LogConfig getLogConfig();
116-
117-
@CheckForNull
118-
LxcConf[] getLxcConf();
119-
12055
@CheckForNull
12156
String getMacAddress();
12257

123-
@CheckForNull
124-
Long getMemory();
125-
126-
@CheckForNull
127-
Long getMemorySwap();
128-
129-
@CheckForNull
130-
Integer getMemorySwappiness();
131-
13258
@CheckForNull
13359
String getName();
13460

135-
@CheckForNull
136-
String getNetworkMode();
137-
138-
@CheckForNull
139-
Ports getPortBindings();
140-
14161
@CheckForNull
14262
String[] getPortSpecs();
14363

144-
@CheckForNull
145-
RestartPolicy getRestartPolicy();
146-
147-
@CheckForNull
148-
Ulimit[] getUlimits();
149-
15064
@CheckForNull
15165
String getUser();
15266

15367
@CheckForNull
15468
Volume[] getVolumes();
15569

156-
@CheckForNull
157-
VolumesFrom[] getVolumesFrom();
158-
15970
@CheckForNull
16071
String getWorkingDir();
16172

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

174-
/**
175-
* @since 1.19
176-
*/
177-
@CheckForNull
178-
Boolean getOomKillDisable();
179-
180-
@CheckForNull
181-
Boolean getPrivileged();
182-
183-
@CheckForNull
184-
Boolean getPublishAllPorts();
185-
186-
@CheckForNull
187-
Boolean getReadonlyRootfs();
188-
18985
@CheckForNull
19086
Boolean isStdInOnce();
19187

19288
@CheckForNull
19389
Boolean isStdinOpen();
19490

195-
@CheckForNull
196-
String getPidMode();
197-
19891
@CheckForNull
19992
HostConfig getHostConfig();
20093

201-
@CheckForNull
202-
String getCgroupParent();
203-
20494
@CheckForNull
20595
Boolean isTty();
20696

@@ -230,89 +120,10 @@ public interface CreateContainerCmd extends SyncDockerCmd<CreateContainerRespons
230120

231121
CreateContainerCmd withAttachStdout(Boolean attachStdout);
232122

233-
CreateContainerCmd withBinds(Bind... binds);
234-
235-
CreateContainerCmd withBinds(List<Bind> binds);
236-
237-
/**
238-
* @since 1.19
239-
*/
240-
CreateContainerCmd withBlkioWeight(Integer blkioWeight);
241-
242-
/**
243-
* Add linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> to the container. For example:
244-
* adding {@link Capability#MKNOD} allows the container to create special files using the 'mknod' command.
245-
*/
246-
CreateContainerCmd withCapAdd(Capability... capAdd);
247-
248-
/**
249-
* Add linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> to the container. For example:
250-
* adding {@link Capability#MKNOD} allows the container to create special files using the 'mknod' command.
251-
*/
252-
CreateContainerCmd withCapAdd(List<Capability> capAdd);
253-
254-
/**
255-
* Drop linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> from the container. For example:
256-
* dropping {@link Capability#CHOWN} prevents the container from changing the owner of any files.
257-
*/
258-
CreateContainerCmd withCapDrop(Capability... capDrop);
259-
260-
/**
261-
* Drop linux <a href="http://man7.org/linux/man-pages/man7/capabilities.7.html">kernel capability</a> from the container. For example:
262-
* dropping {@link Capability#CHOWN} prevents the container from changing the owner of any files.
263-
*/
264-
CreateContainerCmd withCapDrop(List<Capability> capDrop);
265-
266123
CreateContainerCmd withCmd(String... cmd);
267124

268125
CreateContainerCmd withCmd(List<String> cmd);
269126

270-
CreateContainerCmd withContainerIDFile(String containerIDFile);
271-
272-
/**
273-
* @since 1.19
274-
*/
275-
CreateContainerCmd withCpuPeriod(Integer cpuPeriod);
276-
277-
CreateContainerCmd withCpusetCpus(String cpusetCpus);
278-
279-
/**
280-
* @since 1.19
281-
*/
282-
CreateContainerCmd withCpusetMems(String cpusetMems);
283-
284-
CreateContainerCmd withCpuShares(Integer cpuShares);
285-
286-
/**
287-
* Add host devices to the container
288-
*/
289-
CreateContainerCmd withDevices(Device... devices);
290-
291-
/**
292-
* Add host devices to the container
293-
*/
294-
CreateContainerCmd withDevices(List<Device> devices);
295-
296-
/**
297-
* Set custom DNS servers
298-
*/
299-
CreateContainerCmd withDns(String... dns);
300-
301-
/**
302-
* Set custom DNS servers
303-
*/
304-
CreateContainerCmd withDns(List<String> dns);
305-
306-
/**
307-
* Set custom DNS search domains
308-
*/
309-
CreateContainerCmd withDnsSearch(String... dnsSearch);
310-
311-
/**
312-
* Set custom DNS search domains
313-
*/
314-
CreateContainerCmd withDnsSearch(List<String> dnsSearch);
315-
316127
CreateContainerCmd withDomainName(String domainName);
317128

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

330141
CreateContainerCmd withExposedPorts(List<ExposedPort> exposedPorts);
331142

332-
/**
333-
* Add hostnames to /etc/hosts in the container
334-
*/
335-
CreateContainerCmd withExtraHosts(String... extraHosts);
336-
337-
/**
338-
* Add hostnames to /etc/hosts in the container
339-
*/
340-
CreateContainerCmd withExtraHosts(List<String> extraHosts);
341-
342143
CreateContainerCmd withHostName(String hostName);
343144

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

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

352-
/**
353-
* Add link to another container.
354-
*/
355-
CreateContainerCmd withLinks(Link... links);
356-
357-
/**
358-
* Add link to another container.
359-
*/
360-
CreateContainerCmd withLinks(List<Link> links);
361-
362-
CreateContainerCmd withLogConfig(LogConfig logConfig);
363-
364-
CreateContainerCmd withLxcConf(LxcConf... lxcConf);
365-
366-
CreateContainerCmd withLxcConf(List<LxcConf> lxcConf);
367-
368153
CreateContainerCmd withMacAddress(String macAddress);
369154

370-
CreateContainerCmd withMemory(Long memory);
371-
372-
CreateContainerCmd withMemorySwap(Long memorySwap);
373-
374-
CreateContainerCmd withMemorySwappiness(Integer memorySwappiness);
375-
376155
CreateContainerCmd withName(String name);
377156

378157
CreateContainerCmd withNetworkDisabled(Boolean disableNetwork);
379158

380-
/**
381-
* Set the Network mode for the container
382-
* <ul>
383-
* <li>'bridge': creates a new network stack for the container on the docker bridge</li>
384-
* <li>'none': no networking for this container</li>
385-
* <li>'container:<name|id>': reuses another container network stack</li>
386-
* <li>'host': use the host network stack inside the container. Note: the host mode gives the container full access to local system
387-
* services such as D-bus and is therefore considered insecure.</li>
388-
* </ul>
389-
*/
390-
CreateContainerCmd withNetworkMode(String networkMode);
391-
392-
/**
393-
* @since 1.19
394-
*/
395-
CreateContainerCmd withOomKillDisable(Boolean oomKillDisable);
396-
397-
/**
398-
* Add one or more {@link PortBinding}s. This corresponds to the <code>--publish</code> (<code>-p</code>) option of the
399-
* <code>docker run</code> CLI command.
400-
*/
401-
CreateContainerCmd withPortBindings(PortBinding... portBindings);
402-
403-
/**
404-
* Add one or more {@link PortBinding}s. This corresponds to the <code>--publish</code> (<code>-p</code>) option of the
405-
* <code>docker run</code> CLI command.
406-
*/
407-
CreateContainerCmd withPortBindings(List<PortBinding> portBindings);
408-
409-
/**
410-
* Add the port bindings that are contained in the given {@link Ports} object.
411-
*
412-
* @see #withPortBindings(PortBinding...)
413-
*/
414-
CreateContainerCmd withPortBindings(Ports portBindings);
415-
416159
CreateContainerCmd withPortSpecs(String... portSpecs);
417160

418161
CreateContainerCmd withPortSpecs(List<String> portSpecs);
419162

420-
CreateContainerCmd withPrivileged(Boolean privileged);
421-
422-
CreateContainerCmd withPublishAllPorts(Boolean publishAllPorts);
423-
424-
CreateContainerCmd withReadonlyRootfs(Boolean readonlyRootfs);
425-
426-
/**
427-
* Set custom {@link RestartPolicy} for the container. Defaults to {@link RestartPolicy#noRestart()}
428-
*/
429-
CreateContainerCmd withRestartPolicy(RestartPolicy restartPolicy);
430-
431163
CreateContainerCmd withStdInOnce(Boolean stdInOnce);
432164

433165
CreateContainerCmd withStdinOpen(Boolean stdinOpen);
434166

435167
CreateContainerCmd withTty(Boolean tty);
436168

437-
CreateContainerCmd withUlimits(Ulimit... ulimits);
438-
439-
CreateContainerCmd withUlimits(List<Ulimit> ulimits);
440-
441169
CreateContainerCmd withUser(String user);
442170

443171
CreateContainerCmd withVolumes(Volume... volumes);
444172

445173
CreateContainerCmd withVolumes(List<Volume> volumes);
446174

447-
CreateContainerCmd withVolumesFrom(VolumesFrom... volumesFrom);
448-
449-
CreateContainerCmd withVolumesFrom(List<VolumesFrom> volumesFrom);
450-
451175
CreateContainerCmd withWorkingDir(String workingDir);
452176

453-
CreateContainerCmd withCgroupParent(String cgroupParent);
454-
455-
/**
456-
* Set the PID (Process) Namespace mode for the container, 'host': use the host's PID namespace inside the container
457-
*/
458-
CreateContainerCmd withPidMode(String pidMode);
459-
460177
CreateContainerCmd withHostConfig(HostConfig hostConfig);
461178

462179
/**

0 commit comments

Comments
 (0)