From f56a79381ba4653af9673c224b7b968cf0ed8b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Wed, 4 Apr 2018 09:44:58 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Introduces=20a=20Netbox=20Docke?= =?UTF-8?q?r=20project=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 +++ README.md | 11 +++++++++++ VERSION | 1 + build.sh | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 VERSION diff --git a/Dockerfile b/Dockerfile index bb67af8..33bf28a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,3 +51,6 @@ VOLUME ["/etc/netbox-nginx/"] CMD ["gunicorn", "-c /etc/netbox/gunicorn_config.py", "netbox.wsgi"] LABEL SRC_URL="$URL" + +ARG NETBOX_DOCKER_PROJECT_VERSION=snapshot +LABEL NETBOX_DOCKER_PROJECT_VERSION="$NETBOX_DOCKER_PROJECT_VERSION" diff --git a/README.md b/README.md index 6741aff..85e7afc 100644 --- a/README.md +++ b/README.md @@ -268,6 +268,17 @@ docker-compose rm -f netbox docker-compose up -d netbox ``` +### Braking Changes + +From time to time it might become necessary to re-order the structure of the container. +Things like the `docker-compose.yml` file or your Kubernets or OpenShift configurations have to be adjusted as a consequence. +Since April 2018 each image built from this repo contains a `NETBOX_DOCKER_PROJECT_VERSION` label. +You can check the label of your local image by running `docker inspect ninech/netbox:v2.3.1 --format "{{json .ContainerConfig.Labels}}"`. + +The following is a list of braking changes: + +* 0.1.0: Introduction of the `NETBOX_DOCKER_PROJECT_VERSION`. (Not a braking change per se.) + ## Rebuilding & Publishing images `./build.sh` is used to rebuild the Docker image: diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/build.sh b/build.sh index 7ae3ec2..89ed9d8 100755 --- a/build.sh +++ b/build.sh @@ -57,6 +57,10 @@ if [ "${1}x" == "x" ] || [ "${1}" == "--help" ] || [ "${1}" == "-h" ]; then fi fi +# read the project version and trim it +# see https://stackoverflow.com/a/3232433/172132 +NETBOX_DOCKER_PROJECT_VERSION="${NETBOX_DOCKER_PROJECT_VERSION-$(sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' VERSION)}" + # variables for fetching the source SRC_ORG="${SRC_ORG-digitalocean}" SRC_REPO="${SRC_REPO-netbox}" @@ -107,6 +111,7 @@ DOCKER_OPTS+=( "--pull" ) # Build args DOCKER_BUILD_ARGS=( + --build-arg "NETBOX_DOCKER_PROJECT_VERSION=${NETBOX_DOCKER_PROJECT_VERSION}" --build-arg "FROM_TAG=${TAG}" --build-arg "BRANCH=${BRANCH}" --build-arg "URL=${URL}" From 0b55a24188605470a4e83caee468e566538b0a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Wed, 4 Apr 2018 09:50:17 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Version=20=E2=89=A0=20?= =?UTF-8?q?Version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 85e7afc..ff57d66 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ COPY startup_scripts/ /opt/netbox/startup_scripts/ COPY initializers/ /opt/netbox/initializers/ ``` -## Version +## Netbox 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.