Skip to content

Commit cea03a6

Browse files
author
Marcus Linke
committed
Fix issue #246
1 parent 22da0a2 commit cea03a6

File tree

114 files changed

+827
-823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+827
-823
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Latest SNAPSHOT
66
* [#306] (https://github.com/docker-java/docker-java/pull/306) fix(core): fix NPE if latestItem is null in result callback
77
* [#305] (https://github.com/docker-java/docker-java/pull/305) chore(core): do not expect default DockerCmdExecFactory service
88
* [#304] (https://github.com/docker-java/docker-java/pull/304) Throw original exception when command.close() throws Exception too
9+
* [#299] (https://github.com/docker-java/docker-java/pull/299) BuildImage sync to 1.20 API
10+
* [#291] (https://github.com/docker-java/docker-java/pull/291) Moved "Memory", "MemorySwap" and "CpuShares" mappings from ContainerConfig to HostConfig
911

1012
v2.0.1
1113
---

src/main/java/com/github/dockerjava/api/async/ResultCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.dockerjava.api.async;
22

33
import java.io.Closeable;
4+
import java.io.IOException;
45

56
/**
67
* Result callback
@@ -20,5 +21,4 @@ public interface ResultCallback<A_RES_T> extends Closeable {
2021

2122
/** Called when processing was finished either by reaching the end or by aborting it */
2223
void onComplete();
23-
2424
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ public interface AttachContainerCmd extends AsyncDockerCmd<AttachContainerCmd, F
2424

2525
public String getContainerId();
2626

27-
public boolean hasLogsEnabled();
27+
public Boolean hasLogsEnabled();
2828

29-
public boolean hasFollowStreamEnabled();
29+
public Boolean hasFollowStreamEnabled();
3030

31-
public boolean hasTimestampsEnabled();
31+
public Boolean hasTimestampsEnabled();
3232

33-
public boolean hasStdoutEnabled();
33+
public Boolean hasStdoutEnabled();
3434

35-
public boolean hasStderrEnabled();
35+
public Boolean hasStderrEnabled();
3636

3737
public AttachContainerCmd withContainerId(String containerId);
3838

3939
/**
40-
* See {@link #withFollowStream(boolean)}
40+
* See {@link #withFollowStream(Boolean)}
4141
*/
4242
public AttachContainerCmd withFollowStream();
4343

@@ -46,19 +46,19 @@ public interface AttachContainerCmd extends AsyncDockerCmd<AttachContainerCmd, F
4646
* {@link InputStream#read()} MAY BLOCK FOREVER as long as no data is streamed from the docker host to
4747
* {@link DockerClient}!
4848
*/
49-
public AttachContainerCmd withFollowStream(boolean followStream);
49+
public AttachContainerCmd withFollowStream(Boolean followStream);
5050

51-
public AttachContainerCmd withTimestamps(boolean timestamps);
51+
public AttachContainerCmd withTimestamps(Boolean timestamps);
5252

5353
public AttachContainerCmd withStdOut();
5454

55-
public AttachContainerCmd withStdOut(boolean stdout);
55+
public AttachContainerCmd withStdOut(Boolean stdout);
5656

5757
public AttachContainerCmd withStdErr();
5858

59-
public AttachContainerCmd withStdErr(boolean stderr);
59+
public AttachContainerCmd withStdErr(Boolean stderr);
6060

61-
public AttachContainerCmd withLogs(boolean logs);
61+
public AttachContainerCmd withLogs(Boolean logs);
6262

6363
public AttachContainerCmd withLogs();
6464

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,30 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
4141
/**
4242
* "nocache" in API
4343
*/
44-
public boolean hasNoCacheEnabled();
44+
public Boolean hasNoCacheEnabled();
4545

4646
/**
4747
* "rm" in API
4848
*/
49-
public boolean hasRemoveEnabled();
49+
public Boolean hasRemoveEnabled();
5050

5151
/**
5252
* "forcerm" in API
5353
*/
54-
public boolean isForcerm();
54+
public Boolean isForcerm();
5555

5656
@CheckForNull
5757
public Boolean getForcerm();
5858

5959
/**
6060
* "q" in API
6161
*/
62-
public boolean isQuiet();
62+
public Boolean isQuiet();
6363

6464
/**
6565
* "pull" in API
6666
*/
67-
public boolean hasPullEnabled();
67+
public Boolean hasPullEnabled();
6868

6969
@CheckForNull
7070
public String getPathToDockerfile();
@@ -93,27 +93,27 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
9393

9494
public BuildImageCmd withNoCache();
9595

96-
public BuildImageCmd withNoCache(boolean noCache);
96+
public BuildImageCmd withNoCache(Boolean noCache);
9797

9898
public BuildImageCmd withRemove();
9999

100-
public BuildImageCmd withRemove(boolean rm);
100+
public BuildImageCmd withRemove(Boolean rm);
101101

102102
public BuildImageCmd withForcerm();
103103

104104
public BuildImageCmd withForcerm(Boolean forcerm);
105105

106106
public BuildImageCmd withQuiet();
107107

108-
public BuildImageCmd withQuiet(boolean quiet);
108+
public BuildImageCmd withQuiet(Boolean quiet);
109109

110110
public BuildImageCmd withPull();
111111

112-
public BuildImageCmd withPull(boolean pull);
112+
public BuildImageCmd withPull(Boolean pull);
113113

114-
public BuildImageCmd withMemory(long memory);
114+
public BuildImageCmd withMemory(Long memory);
115115

116-
public BuildImageCmd withMemswap(long memswap);
116+
public BuildImageCmd withMemswap(Long memswap);
117117

118118
public BuildImageCmd withCpushares(String cpushares);
119119

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ public interface CommitCmd extends SyncDockerCmd<String> {
2323

2424
public String getAuthor();
2525

26-
public boolean hasPauseEnabled();
26+
public Boolean hasPauseEnabled();
2727

28-
public CommitCmd withAttachStderr(boolean attachStderr);
28+
public CommitCmd withAttachStderr(Boolean attachStderr);
2929

3030
public CommitCmd withAttachStderr();
3131

32-
public CommitCmd withAttachStdin(boolean attachStdin);
32+
public CommitCmd withAttachStdin(Boolean attachStdin);
3333

3434
public CommitCmd withAttachStdin();
3535

36-
public CommitCmd withAttachStdout(boolean attachStdout);
36+
public CommitCmd withAttachStdout(Boolean attachStdout);
3737

3838
public CommitCmd withAttachStdout();
3939

4040
public CommitCmd withCmd(String... cmd);
4141

42-
public CommitCmd withDisableNetwork(boolean disableNetwork);
42+
public CommitCmd withDisableNetwork(Boolean disableNetwork);
4343

4444
public CommitCmd withAuthor(String author);
4545

@@ -49,7 +49,7 @@ public interface CommitCmd extends SyncDockerCmd<String> {
4949

5050
public CommitCmd withRepository(String repository);
5151

52-
public CommitCmd withPause(boolean pause);
52+
public CommitCmd withPause(Boolean pause);
5353

5454
public String[] getEnv();
5555

@@ -71,23 +71,23 @@ public interface CommitCmd extends SyncDockerCmd<String> {
7171

7272
public CommitCmd withMemorySwap(Integer memorySwap);
7373

74-
public boolean isOpenStdin();
74+
public Boolean isOpenStdin();
7575

76-
public CommitCmd withOpenStdin(boolean openStdin);
76+
public CommitCmd withOpenStdin(Boolean openStdin);
7777

7878
public String[] getPortSpecs();
7979

8080
public CommitCmd withPortSpecs(String... portSpecs);
8181

82-
public boolean isStdinOnce();
82+
public Boolean isStdinOnce();
8383

84-
public CommitCmd withStdinOnce(boolean stdinOnce);
84+
public CommitCmd withStdinOnce(Boolean stdinOnce);
8585

8686
public CommitCmd withStdinOnce();
8787

88-
public boolean isTty();
88+
public Boolean isTty();
8989

90-
public CommitCmd withTty(boolean tty);
90+
public CommitCmd withTty(Boolean tty);
9191

9292
public CommitCmd withTty();
9393

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

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
4040

4141
public String[] getCmd();
4242

43-
public String getCpuset();
43+
public String getCpusetCpus();
4444

45-
public int getCpuShares();
45+
public Integer getCpuShares();
4646

4747
/**
4848
* @since 1.19
@@ -92,9 +92,9 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
9292

9393
public String getMacAddress();
9494

95-
public long getMemoryLimit();
95+
public Long getMemory();
9696

97-
public long getMemorySwap();
97+
public Long getMemorySwap();
9898

9999
public String getName();
100100

@@ -116,29 +116,31 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
116116

117117
public Ulimit[] getUlimits();
118118

119-
public boolean isAttachStderr();
119+
public Boolean isAttachStderr();
120120

121-
public boolean isAttachStdin();
121+
public Boolean isAttachStdin();
122122

123-
public boolean isAttachStdout();
123+
public Boolean isAttachStdout();
124124

125-
public boolean isNetworkDisabled();
125+
public Boolean isNetworkDisabled();
126126

127127
public Boolean isPrivileged();
128128

129129
public Boolean isPublishAllPorts();
130130

131-
public boolean isStdInOnce();
131+
public Boolean isReadonlyRootfs();
132132

133-
public boolean isStdinOpen();
133+
public Boolean isStdInOnce();
134134

135-
public boolean isTty();
135+
public Boolean isStdinOpen();
136136

137-
public CreateContainerCmd withAttachStderr(boolean attachStderr);
137+
public Boolean isTty();
138138

139-
public CreateContainerCmd withAttachStdin(boolean attachStdin);
139+
public CreateContainerCmd withAttachStderr(Boolean attachStderr);
140140

141-
public CreateContainerCmd withAttachStdout(boolean attachStdout);
141+
public CreateContainerCmd withAttachStdin(Boolean attachStdin);
142+
143+
public CreateContainerCmd withAttachStdout(Boolean attachStdout);
142144

143145
public CreateContainerCmd withBinds(Bind... binds);
144146

@@ -158,9 +160,9 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
158160

159161
public CreateContainerCmd withCmd(String... cmd);
160162

161-
public CreateContainerCmd withCpuset(String cpuset);
163+
public CreateContainerCmd withCpusetCpus(String cpusetCpus);
162164

163-
public CreateContainerCmd withCpuShares(int cpuShares);
165+
public CreateContainerCmd withCpuShares(Integer cpuShares);
164166

165167
/**
166168
* @since 1.19
@@ -187,7 +189,7 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
187189
*/
188190
public CreateContainerCmd withDevices(Device... devices);
189191

190-
public CreateContainerCmd withNetworkDisabled(boolean disableNetwork);
192+
public CreateContainerCmd withNetworkDisabled(Boolean disableNetwork);
191193

192194
/**
193195
* Set custom DNS servers
@@ -227,9 +229,9 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
227229

228230
public CreateContainerCmd withLogConfig(LogConfig logConfig);
229231

230-
public CreateContainerCmd withMemoryLimit(long memoryLimit);
232+
public CreateContainerCmd withMemory(Long memory);
231233

232-
public CreateContainerCmd withMemorySwap(long memorySwap);
234+
public CreateContainerCmd withMemorySwap(Long memorySwap);
233235

234236
public CreateContainerCmd withName(String name);
235237

@@ -260,20 +262,20 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
260262

261263
public CreateContainerCmd withPortSpecs(String... portSpecs);
262264

263-
public CreateContainerCmd withPrivileged(boolean privileged);
265+
public CreateContainerCmd withPrivileged(Boolean privileged);
264266

265-
public CreateContainerCmd withPublishAllPorts(boolean publishAllPorts);
267+
public CreateContainerCmd withPublishAllPorts(Boolean publishAllPorts);
266268

267269
/**
268270
* Set custom {@link RestartPolicy} for the container. Defaults to {@link RestartPolicy#noRestart()}
269271
*/
270272
public CreateContainerCmd withRestartPolicy(RestartPolicy restartPolicy);
271273

272-
public CreateContainerCmd withStdInOnce(boolean stdInOnce);
274+
public CreateContainerCmd withStdInOnce(Boolean stdInOnce);
273275

274-
public CreateContainerCmd withStdinOpen(boolean stdinOpen);
276+
public CreateContainerCmd withStdinOpen(Boolean stdinOpen);
275277

276-
public CreateContainerCmd withTty(boolean tty);
278+
public CreateContainerCmd withTty(Boolean tty);
277279

278280
public CreateContainerCmd withUser(String user);
279281

@@ -287,7 +289,7 @@ public static interface Exec extends DockerCmdSyncExec<CreateContainerCmd, Creat
287289

288290
public CreateContainerCmd withUlimits(Ulimit[] ulimits);
289291

290-
public CreateContainerCmd withReadonlyRootfs(boolean readonlyRootfs);
292+
public CreateContainerCmd withReadonlyRootfs(Boolean readonlyRootfs);
291293

292294
public CreateContainerCmd withContainerIDFile(String containerIDFile);
293295

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ public interface ExecCreateCmd extends SyncDockerCmd<ExecCreateCmdResponse> {
88

99
public ExecCreateCmd withCmd(String... cmd);
1010

11-
public ExecCreateCmd withAttachStdin(boolean attachStdin);
11+
public ExecCreateCmd withAttachStdin(Boolean attachStdin);
1212

1313
public ExecCreateCmd withAttachStdin();
1414

15-
public boolean hasAttachStdinEnabled();
15+
public Boolean hasAttachStdinEnabled();
1616

17-
public ExecCreateCmd withAttachStdout(boolean attachStdout);
17+
public ExecCreateCmd withAttachStdout(Boolean attachStdout);
1818

1919
public ExecCreateCmd withAttachStdout();
2020

21-
public boolean hasAttachStdoutEnabled();
21+
public Boolean hasAttachStdoutEnabled();
2222

23-
public ExecCreateCmd withAttachStderr(boolean attachStderr);
23+
public ExecCreateCmd withAttachStderr(Boolean attachStderr);
2424

2525
public ExecCreateCmd withAttachStderr();
2626

27-
public boolean hasAttachStderrEnabled();
27+
public Boolean hasAttachStderrEnabled();
2828

29-
public ExecCreateCmd withTty(boolean tty);
29+
public ExecCreateCmd withTty(Boolean tty);
3030

3131
public ExecCreateCmd withTty();
3232

33-
public boolean hasTtyEnabled();
33+
public Boolean hasTtyEnabled();
3434

3535
public static interface Exec extends DockerCmdSyncExec<ExecCreateCmd, ExecCreateCmdResponse> {
3636
}

0 commit comments

Comments
 (0)