Document the use of the build variable

This commit is contained in:
Christian Mäder 2017-10-16 13:33:12 +02:00
parent ec8bc17289
commit 843342d972
No known key found for this signature in database
GPG Key ID: 92FFD0A711F196BB
2 changed files with 29 additions and 2 deletions

View File

@ -47,6 +47,33 @@ To ensure this, compare the output of `docker --version` and `docker-compose --v
You can configure the app using environment variables. These are defined in `netbox.env`.
## Version
The `docker-compose.yml` file is prepared to run a specific version of Netbox.
To use this feature, set the environment-variable `VERSION` before launching `docker-compose`, as shown below.
`VERSION` may be set to the name of
[any tag of the `ninech/netbox` Docker image](https://hub.docker.com/r/ninech/netbox/tags/).
```
$ export VERSION=v2.2.1
$ docker-compose pull netbox
$ docker-compose up -d
```
You can also build a specific version of the Netbox image. This time, `VERSION` indicates any valid
[Git Reference](https://git-scm.com/book/en/v2/Git-Internals-Git-References) declared on
[the Netbox Github repository](https://github.com/digitalocean/netbox/releases).
Most commonly you will specify a tag name or a branch name.
```
$ export VERSION=develop
$ docker-compose build --no-cache netbox
$ docker-compose up -d
```
Hint: If you're building a specific version by tag name, the `--no-cache` argument is not strictly necessary.
This can increase the build speed if you're just adjusting the config, for example.
## Rebuilding & Publishing images
`./build.sh` is used to rebuild the Docker image:

View File

@ -4,8 +4,8 @@ services:
build:
context: .
args:
- BRANCH=${BRANCH-master}
image: ninech/netbox:${BRANCH-latest}
- BRANCH=${VERSION-master}
image: ninech/netbox:${VERSION-latest}
depends_on:
- postgres
env_file: netbox.env