Skip to content

Commit f493c8b

Browse files
author
Marcus Linke
committed
Merge branch 'buildImage' of https://github.com/KostyaSha/docker-java into KostyaSha-buildImage
2 parents 11f5c7f + 32d0f93 commit f493c8b

4 files changed

Lines changed: 268 additions & 65 deletions

File tree

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@
194194
<version>${hamcrest.jpa-matchers}</version>
195195
<scope>test</scope>
196196
</dependency>
197+
198+
<dependency>
199+
<groupId>com.google.code.findbugs</groupId>
200+
<artifactId>annotations</artifactId>
201+
<version>3.0.0</version>
202+
<scope>provided</scope>
203+
</dependency>
197204
</dependencies>
198205

199206
<distributionManagement>

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

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,95 @@
11
package com.github.dockerjava.api.command;
22

3-
import java.io.File;
4-
import java.io.InputStream;
5-
63
import com.github.dockerjava.api.model.AuthConfigurations;
74
import com.github.dockerjava.api.model.BuildResponseItem;
85

6+
import javax.annotation.CheckForNull;
7+
import java.io.File;
8+
import java.io.InputStream;
9+
import java.net.URI;
10+
911
/**
10-
*
1112
* Build an image from Dockerfile.
12-
*
13+
* <p>
1314
* TODO: http://docs.docker.com/reference/builder/#dockerignore
1415
*
16+
* @see <a href="https://docs.docker.com/reference/api/docker_remote_api_v1.20/#build-image-from-a-dockerfile">build-image-from-a-dockerfile</a>
1517
*/
1618
public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildResponseItem> {
1719

18-
public BuildImageCmd withTag(String tag);
20+
// lib specific
1921

2022
public InputStream getTarInputStream();
2123

24+
public AuthConfigurations getBuildAuthConfigs();
25+
26+
// getters
27+
28+
/**
29+
* "t" in API
30+
*/
31+
@CheckForNull
2232
public String getTag();
2333

34+
/**
35+
* "remote" in API
36+
*/
37+
@CheckForNull
38+
public URI getRemote();
39+
40+
/**
41+
* "nocache" in API
42+
*/
2443
public boolean hasNoCacheEnabled();
2544

45+
/**
46+
* "rm" in API
47+
*/
2648
public boolean hasRemoveEnabled();
2749

50+
/**
51+
* "forcerm" in API
52+
*/
53+
public boolean isForcerm();
54+
55+
@CheckForNull
56+
public Boolean getForcerm();
57+
58+
/**
59+
* "q" in API
60+
*/
2861
public boolean isQuiet();
2962

63+
/**
64+
* "pull" in API
65+
*/
3066
public boolean hasPullEnabled();
3167

68+
@CheckForNull
3269
public String getPathToDockerfile();
3370

34-
public AuthConfigurations getBuildAuthConfigs();
71+
@CheckForNull
72+
public Long getMemory();
73+
74+
@CheckForNull
75+
public Long getMemswap();
76+
77+
@CheckForNull
78+
public String getCpushares();
79+
80+
@CheckForNull
81+
public String getCpusetcpus();
82+
83+
// setters
84+
85+
public BuildImageCmd withTag(String tag);
86+
87+
public BuildImageCmd withRemote(URI remote);
3588

3689
public BuildImageCmd withBaseDirectory(File baseDirectory);
3790

3891
public BuildImageCmd withDockerfile(File dockerfile);
3992

40-
public BuildImageCmd withTarInputStream(InputStream tarInputStream);
41-
4293
public BuildImageCmd withNoCache();
4394

4495
public BuildImageCmd withNoCache(boolean noCache);
@@ -47,6 +98,10 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
4798

4899
public BuildImageCmd withRemove(boolean rm);
49100

101+
public BuildImageCmd withForcerm();
102+
103+
public BuildImageCmd withForcerm(Boolean forcerm);
104+
50105
public BuildImageCmd withQuiet();
51106

52107
public BuildImageCmd withQuiet(boolean quiet);
@@ -55,8 +110,20 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
55110

56111
public BuildImageCmd withPull(boolean pull);
57112

113+
public BuildImageCmd withMemory(long memory);
114+
115+
public BuildImageCmd withMemswap(long memswap);
116+
117+
public BuildImageCmd withCpushares(String cpushares);
118+
119+
public BuildImageCmd withCpusetcpus(String cpusetcpus);
120+
121+
// setters lib specific
122+
58123
public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfig);
59124

125+
public BuildImageCmd withTarInputStream(InputStream tarInputStream);
126+
60127
public static interface Exec extends DockerCmdAsyncExec<BuildImageCmd, BuildResponseItem> {
61128
}
62129

0 commit comments

Comments
 (0)