8000 GitHub - vanioinformatika/docker-publish at 56b4ebad7bdad5205667890e641da7ec9f1fdf8c
[go: up one dir, main page]

Skip to content

vanioinformatika/docker-publish

Repository files navigation

Docker Publish

Travis Standard - JavaScript Style Guide npm downloads npm version

Simple Docker tagging and publishing from npm


Install:

npm i -D @vanioinformatika/docker-publish

Creating tags and push into Docker Registry with one command.

In package.json postversion:

postversion: "... && docker-publish"

or

node ./node_modules/.bin/docker-publish

Releasing

Best practice: Running npm version, and postversion contains docker-publish.

docker tag docker-publish:latest docker-publish:v1
docker tag docker-publish:latest docker-publish:v1.3
docker tag docker-publish:latest docker-publish:v1.3.5
docker tag docker-publish:latest docker-publish:v1.3.5-RELEASE-g993df1b
docker tag docker-publish:latest docker-publish:latest
docker push docker-publish:v1
docker push docker-publish:v1.3
docker push docker-publish:v1.3.5
docker push docker-publish:v1.3.5-RELEASE-g993df1b
docker push docker-publish:latest

v1.3.5-RELEASE-g993df1b: v1.3.5 - your version number from project.json, g993df1b - git commit ID (7 chars)

Snapshot

If you want to publish a snapshot, the image will be tagged with git commit id, and the commit's number since last version, and pushed.


docker tag docker-publish:latest docker-publish:v1.3.4-5-gb4c008b
docker push docker-publish:v1.3.4-1-gb4c008b

v1.3.5-RELEASE-g993df1b: v1.3.5 - your version number from project.json, 5 - commit's number since v1.3.4 tag, gb4c008b - last (fifth) git commit ID (7 chars

If you have never tagged git commit, then tag shows:

skipped: docker tag docker-publish:latest docker-publish:0bd4c74
skipped: docker push docker-publish:0bd4c74

Where 0bd4c74 is the last commit id.

Configuration

There is zero configuration. All parameters comes from package.json: name and version properties.

* Maybe you want to use your own private docker repository, in this case please see the next chapter.

Customization

Optionally, in package.json you can customize your docker properties:

'version': '1.3.5',
'name': 'docker-publish',
'config': {
  'docker': {
    'ns': 'namespace',
    'url': 'docker.yourcompany.com:5000',
    'name': 'myapp',
    'skip': false,
    'silence': false
  }
}

CLI parameters could overwites package.json properties (except version number).

  • DOCKER_URL your private docker repository URL; docker.yourcompany.com:5000

  • DOCKER_NS your namespace for image; namespace/imagename:tag Default: empty

  • DOCKER_NAME overwrite image name. Default: package.json name properties

  • DOCKER_SKIP Skip Docker tag and push commands (dry run with logging). Default: false

  • DOCKER_SILENCE Do not logging. Default: false

About

Zero-Configuration Docker Publishing from npm

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0