File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,11 @@ func main() {
183183 Usage : "images to consider as cache sources" ,
184184 EnvVar : "PLUGIN_CACHE_FROM" ,
185185 },
186+ cli.StringFlag {
187+ Name : "cache-to" ,
188+ Usage : "images to consider as cache stores" ,
189+ EnvVar : "PLUGIN_CACHE_TO" ,
190+ },
186191 cli.BoolFlag {
187192 Name : "squash" ,
188193 Usage : "squash the layers at build time" ,
@@ -370,6 +375,7 @@ func run(c *cli.Context) error {
370375 Squash : c .Bool ("squash" ),
371376 Pull : c .BoolT ("pull-image" ),
372377 CacheFrom : c .StringSlice ("cache-from" ),
378+ CacheTo : c .String ("cache-to" ),
373379 Compress : c .Bool ("compress" ),
374380 Repo : c .String ("repo" ),
375381 Labels : c .StringSlice ("custom-labels" ),
Original file line number Diff line number Diff line change 6161 Squash bool // Docker build squash
6262 Pull bool // Docker build pull
6363 CacheFrom []string // Docker build cache-from
64+ CacheTo string // Docker build cache-to
6465 Compress bool // Docker build compress
6566 Repo string // Docker build repository
6667 LabelSchema []string // label-schema Label map
@@ -414,6 +415,9 @@ func commandBuild(build Build) *exec.Cmd {
414415 for _ , arg := range build .CacheFrom {
415416 args = append (args , "--cache-from" , arg )
416417 }
418+ if build .CacheTo != "" {
419+ args = append (args , "--cache-to" , build .CacheTo )
420+ }
417421 for _ , arg := range build .ArgsEnv {
418422 addProxyValue (& build , arg )
419423 }
You can’t perform that action at this time.
0 commit comments