Skip to content

Commit

Permalink
Update readme to explain versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
devste committed Apr 24, 2019
1 parent 640a068 commit 84c7139
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,40 @@ This is a Docker image containing pre-commit.

## Goal

This image provides a base to create derived images containing specific pre-commit tools. It is based on Ubuntu, which should increase the chance that a derived image can simply use the package manager to install a required package.
This image provides a base to create derived images containing specific pre-commit tools. Currently, it is based on Ubuntu. This should increase the chance that a derived image can simply use the package manager to install a required package.

Example derived image Dockerfile:

```
FROM petzi/pre-commit:1.15.2-ubuntu.18.10
FROM petzi/pre-commit:1.15.2
RUN apt-get install -y --no-install-recommends \
yamllint
```

## Versioning

### Git

The project uses semantic versioning.

1. The main version number denotes the pre-commit version used.
1. The pre-release part denotes the base docker image used. Codenames of the distributions are not used, as version numbers of the distributions are better suited to produce semver-like precedence.
1. The pre-release part refers to a revision used inside this repository.

A git tag will typically look like this.

```
1.15.2-6
```

### Docker image tag

This repository uses docker hub autobuild and derives many image tags from one build. A build from `1.15.2-6` will thus create the following tags:

1. `1.15.2`
1. `1.15.2-6`
1. `1.15.2-ubuntu`
1. `1.15.2-ubuntu-6`
1. `1.15.2-ubuntu.18.10`
1. `1.15.2-ubuntu.18.10-6`

`1.15.2-ubuntu.18.10` is pre-commit version 1.15.2 built from Ubuntu 18.10 base image.
Choosing the right version to base your derived image on depends on your need for stability. If you reliably need to depend on the correct version of Ubuntu, use a tag such as `1.15.2-ubuntu.18.10`. If you reliably need to depend on a certain revision from within this repository, but the operating system is irrelevant, us a tag such as `1.15.2-6`.

0 comments on commit 84c7139

Please sign in to comment.