push (local device): Add --pull option to force pulling base images again

Connects-to: #1584
Change-type: minor
This commit is contained in:
Paulo Castro 2020-09-08 14:55:56 +01:00
parent 73f49765ec
commit 93e18bea27
3 changed files with 14 additions and 0 deletions

View File

@ -2188,6 +2188,11 @@ purposes" (as the cloud builder needs previous images to compute delta
updates), but the logs will not display the "Using cache" lines for each
build step of a Dockerfile.
#### --pull
When pushing to a local device, force the base images to be pulled again.
Currently this option is ignored when pushing to the balenaCloud builders.
#### --noparent-check
Disable project validation check of 'docker-compose.yml' file in parent folder

View File

@ -33,6 +33,7 @@ interface FlagsDef {
emulated: boolean;
dockerfile?: string; // DeviceDeployOptions.dockerfilePath (alternative Dockerfile)
nocache?: boolean;
pull?: boolean;
'noparent-check'?: boolean;
'registry-secrets'?: string;
gitignore?: boolean;
@ -138,6 +139,11 @@ export default class PushCmd extends Command {
build step of a Dockerfile.`,
char: 'c',
}),
pull: flags.boolean({
description: stripIndent`
When pushing to a local device, force the base images to be pulled again.
Currently this option is ignored when pushing to the balenaCloud builders.`,
}),
'noparent-check': flags.boolean({
description: stripIndent`
Disable project validation check of 'docker-compose.yml' file in parent folder`,
@ -310,6 +316,7 @@ export default class PushCmd extends Command {
registrySecrets,
multiDockerignore: options['multi-dockerignore'] || false,
nocache: options.nocache || false,
pull: options.pull || false,
nogitignore,
noParentCheck: options['noparent-check'] || false,
nolive: options.nolive || false,

View File

@ -58,6 +58,7 @@ export interface DeviceDeployOptions {
nogitignore: boolean;
noParentCheck: boolean;
nolive: boolean;
pull: boolean;
detached: boolean;
services?: string[];
system: boolean;
@ -526,6 +527,7 @@ async function assignDockerBuildOpts(
t: generateImageName(task.serviceName),
nocache: opts.nocache,
forcerm: true,
pull: opts.pull,
};
if (task.external) {
task.dockerOpts.authconfig = await getAuthConfigObj(