File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
src/main/groovy/com/palantir/gradle/docker Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 6868- ` builder ` (optional) a string argument which defines which builder buildx should use; defaults to ` null `
6969- ` load ` (optional) a boolean argument which defines whether Docker buildx builder should add --load flag,
7070 loading the image into the local repository; defaults to ` false `
71+ - ` push ` (optional) a boolean argument which defines whether Docker buildx builder should add --push flag,
72+ pushing the image into the remote registry; defaults to ` false `
7173
7274To build a docker container, run the ` docker ` task. To push that container to a
7375docker repository, run the ` dockerPush ` task.
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ class DockerExtension {
4545 private boolean buildx = false
4646 private Set<String > platform = ImmutableSet . of()
4747 private boolean load = false
48+ private boolean push = false
4849 private String builder = null
4950
5051 private File resolvedDockerfile = null
@@ -188,6 +189,14 @@ class DockerExtension {
188189 this . pull = pull
189190 }
190191
192+ public boolean getPush () {
193+ return push
194+ }
195+
196+ public void push (boolean push ) {
197+ this . push = push
198+ }
199+
191200 boolean getBuildx () {
192201 return buildx
193202 }
Original file line number Diff line number Diff line change @@ -181,6 +181,12 @@ class PalantirDockerPlugin implements Plugin<Project> {
181181 if (ext. load) {
182182 buildCommandLine. add ' --load'
183183 }
184+ if (ext. push) {
185+ buildCommandLine. add ' --push'
186+ if (ext. load) {
187+ throw new Exception (" cannot combine 'push' and 'load' options" )
188+ }
189+ }
184190 if (ext. builder != null ) {
185191 buildCommandLine. addAll(' --builder' , ext. builder)
186192 }
You can’t perform that action at this time.
0 commit comments