|
1 | 1 | package com.github.dockerjava.core.command; |
2 | 2 |
|
3 | | -import static com.google.common.base.Preconditions.checkNotNull; |
| 3 | +import com.github.dockerjava.api.command.BuildImageCmd; |
| 4 | +import com.github.dockerjava.api.model.AuthConfigurations; |
| 5 | +import com.github.dockerjava.api.model.BuildResponseItem; |
| 6 | +import com.github.dockerjava.core.dockerfile.Dockerfile; |
| 7 | +import com.github.dockerjava.core.util.FilePathUtil; |
4 | 8 |
|
| 9 | +import javax.annotation.CheckForNull; |
5 | 10 | import java.io.File; |
6 | 11 | import java.io.IOException; |
7 | 12 | import java.io.InputStream; |
|
10 | 15 | import java.util.Map; |
11 | 16 | import java.util.Set; |
12 | 17 |
|
13 | | -import com.github.dockerjava.api.command.BuildImageCmd; |
14 | | -import com.github.dockerjava.api.model.AuthConfigurations; |
15 | | -import com.github.dockerjava.api.model.BuildResponseItem; |
16 | | -import com.github.dockerjava.core.dockerfile.Dockerfile; |
17 | | -import com.github.dockerjava.core.util.FilePathUtil; |
18 | | - |
19 | | -import javax.annotation.CheckForNull; |
| 18 | +import static com.google.common.base.Preconditions.checkNotNull; |
20 | 19 |
|
21 | 20 | /** |
22 | 21 | * Build an image from Dockerfile. |
@@ -72,6 +71,8 @@ public class BuildImageCmdImpl extends AbstrAsyncDockerCmd<BuildImageCmd, BuildR |
72 | 71 |
|
73 | 72 | private String target; |
74 | 73 |
|
| 74 | + private Set<String> extraHosts; |
| 75 | + |
75 | 76 | public BuildImageCmdImpl(BuildImageCmd.Exec exec) { |
76 | 77 | super(exec); |
77 | 78 | } |
@@ -218,6 +219,11 @@ public Long getShmsize() { |
218 | 219 | return shmsize; |
219 | 220 | } |
220 | 221 |
|
| 222 | + @Override |
| 223 | + public Set<String> getExtraHosts() { |
| 224 | + return extraHosts; |
| 225 | + } |
| 226 | + |
221 | 227 | // setters |
222 | 228 |
|
223 | 229 | /** |
@@ -402,6 +408,12 @@ public BuildImageCmd withTarget(String target) { |
402 | 408 | return this; |
403 | 409 | } |
404 | 410 |
|
| 411 | + @Override |
| 412 | + public BuildImageCmd withExtraHosts(Set<String> extraHosts) { |
| 413 | + this.extraHosts = extraHosts; |
| 414 | + return this; |
| 415 | + } |
| 416 | + |
405 | 417 | @Override |
406 | 418 | public void close() { |
407 | 419 | super.close(); |
|
0 commit comments