Skip to content

Commit

Permalink
feat: disable push into :latest tag (#12)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: no longer pushes latest tag without a special flag of `--tag_latest`
  • Loading branch information
pajgo authored and AVVS committed Sep 19, 2019
1 parent c8c15b6 commit 114c99f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bin/cmds/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ exports.builder = (yargs) => (
boolean: true,
default: true,
})
.option('tag_latest', {
alias: 'tl',
describe: 'adds :latest tag to the image',
boolean: true,
default: false,
})
.option('docker_file', {
alias: 'f',
describe: 'path to docker file',
Expand All @@ -33,13 +39,18 @@ exports.handler = (argv) => {
argv.base = `${argv.repository}/${argv.project}`;
argv.baseTag = argv.include_node ? `${argv.node}-${argv.version}` : argv.version;
argv.mainTag = `${argv.base}:${argv.baseTag}`;
argv.tags = [`${argv.base}:latest`];
argv.tags = [];

// adds extra tag
if (argv.include_node) {
argv.tags.push(`${argv.base}:${argv.node}`);
}

// adds :latest tag
if (argv.tag_latest) {
argv.tags.push(`${argv.base}:latest`);
}

// a little bit hacky
exports.called = true;
};
10 changes: 10 additions & 0 deletions doc/rfc/docker_disable_latest_tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Disable push using `:latest` tag

## Overview and Motivation
`docker deploy/release/` command pushes images with `baseTag:latest` tag into Docker Hub.
This happens even if we built a beta or alpha version of the image. If the project has docker image dependency without version tag,
this beta image will be used.

## `--tag_latest [false]` param
New `--tag_latest` param(defaults to false) instruct `deploy` command to add `${baseTag}:latest` tag to the image.
Otherwise `:latest` tag not assigned to the image.

0 comments on commit 114c99f

Please sign in to comment.