@@ -45,6 +45,14 @@ type (
4545 NoCache bool // Docker build no-cache
4646 AddHost []string // Docker build add-host
4747 Quiet bool // Docker build quiet
48+ S3CacheDir string
49+ S3Bucket string
50+ S3Endpoint string
51+ S3Region string
52+ S3Key string
53+ S3Secret string
54+ S3UseSSL bool
55+ Layers bool
4856 }
4957
5058 // Plugin defines the Docker plugin parameters.
@@ -190,6 +198,7 @@ func commandInfo() *exec.Cmd {
190198func commandBuild (build Build ) * exec.Cmd {
191199 args := []string {
192200 "bud" ,
201+ "--storage-driver" , "vfs" ,
193202 "-f" , build .Dockerfile ,
194203 }
195204
@@ -223,6 +232,30 @@ func commandBuild(build Build) *exec.Cmd {
223232 if build .Quiet {
224233 args = append (args , "--quiet" )
225234 }
235+ if build .Layers {
236+ args = append (args , "--layers=true" )
237+ if build .S3CacheDir != "" {
238+ args = append (args , "--s3-local-cache-dir" , build .S3CacheDir )
239+ if build .S3Bucket != "" {
240+ args = append (args , "--s3-bucket" , build .S3Bucket )
241+ }
242+ if build .S3Endpoint != "" {
243+ args = append (args , "--s3-endpoint" , build .S3Endpoint )
244+ }
245+ if build .S3Region != "" {
246+ args = append (args , "--s3-region" , build .S3Region )
247+ }
248+ if build .S3Key != "" {
249+ args = append (args , "--s3-key" , build .S3Key )
250+ }
251+ if build .S3Secret != "" {
252+ args = append (args , "--s3-secret" , build .S3Secret )
253+ }
254+ if build .S3UseSSL {
255+ args = append (args , "--s3-use-ssl=true" )
256+ }
257+ }
258+ }
226259
227260 if build .AutoLabel {
228261 labelSchema := []string {
@@ -303,14 +336,14 @@ func commandTag(build Build, tag string) *exec.Cmd {
303336 target = fmt .Sprintf ("%s:%s" , build .Repo , tag )
304337 )
305338 return exec .Command (
306- buildahExe , "tag" , source , target ,
339+ buildahExe , "tag" , "--storage-driver" , "vfs" , source , target ,
307340 )
308341}
309342
310343// helper function to create the docker push command.
311344func commandPush (build Build , tag string ) * exec.Cmd {
312345 target := fmt .Sprintf ("%s:%s" , build .Repo , tag )
313- return exec .Command (buildahExe , "push" , target )
346+ return exec .Command (buildahExe , "push" , "--storage-driver" , "vfs" , target )
314347}
315348
316349// helper to check if args match "docker prune"
@@ -324,7 +357,7 @@ func isCommandRmi(args []string) bool {
324357}
325358
326359func commandRmi (tag string ) * exec.Cmd {
327- return exec .Command (buildahExe , "rmi" , tag )
360+ return exec .Command (buildahExe , "--storage-driver" , "vfs" , " rmi" , tag )
328361}
329362
330363// trace writes each command to stdout with the command wrapped in an xml
0 commit comments