Merge pull request #1617 from balena-io/1616-deploy-cachefrom

Add '--cachefrom' option to balena build/deploy commands
This commit is contained in:
Paulo Castro 2020-02-14 15:25:25 +00:00 committed by GitHub
commit e773549297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -1968,6 +1968,10 @@ The alias to the generated image
Set a build-time variable (eg. "-B 'ARG=value'"). Can be specified multiple times.
#### --cache-from <image-list>
Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the "docker build --cache-from" option.
#### --nocache
Don't use docker layer caching when building
@ -2097,6 +2101,10 @@ The alias to the generated image
Set a build-time variable (eg. "-B 'ARG=value'"). Can be specified multiple times.
#### --cache-from <image-list>
Comma-separated list (no spaces) of image names for build cache resolution. Implements the same feature as the "docker build --cache-from" option.
#### --nocache
Don't use docker layer caching when building

View File

@ -83,6 +83,13 @@ exports.appendOptions = (opts) ->
description: 'Set a build-time variable (eg. "-B \'ARG=value\'"). Can be specified multiple times.'
alias: 'B'
},
{
signature: 'cache-from'
parameter: 'image-list'
description: '
Comma-separated list (no spaces) of image names for build cache resolution.
Implements the same feature as the "docker build --cache-from" option.'
},
{
signature: 'nocache'
description: "Don't use docker layer caching when building"
@ -160,6 +167,8 @@ exports.generateBuildOpts = (options) ->
opts.t = options.tag
if options.nocache?
opts.nocache = true
if options['cache-from']?.trim()
opts.cachefrom = options['cache-from'].split(',').filter((i) -> !!i.trim())
if options.squash?
opts.squash = true
if options.buildArg?