https://github.com/1602/docker-build-with-meta
https://github.com/1602/docker-build-with-meta
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/1602/docker-build-with-meta
- Owner: 1602
- Created: 2016-08-07T15:06:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-10T04:23:15.000Z (over 9 years ago)
- Last Synced: 2025-01-26T18:13:31.377Z (over 1 year ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Docker build with meta
This package builds `docker build ` command using meta info from git:
- last commit sha
- last commit message
- last commit author
- git user name
## Installation
Add to project's dev dependencies
```
npm i -D dokcer-build-with-meta
```
Use as part of build process (add to "scripts" section in package.json):
```
...
"postbuild": "docker-build-with-meta -t latest -p",
...
```
## Usage
Run in directory with package.json and .git
```
docker-build-with-meta -t latest -n projectname -p
```
all arguments are optional:
```
-t project tag (default to latest)
-n project name (default to what specified in package.json)
-p whether publish to registry (not published when omitted)
-h usage info
```
The package.json file must include name, version and organisation keys on top level.
Example of `psFormat` for `~/.docker/config.json`:
```
"psFormat": "table {{.Label \"com.docker.compose.service\"}}\t{{.Label \"version\"}}\t{{.Label \"release-date\"}}\t{{.Status}}\t{{.Label \"commit-sha\"}}\t{{.Label \"released-by\"}}",
```
## LICENSE
MIT