Skip to content

Commit 5022a2e

Browse files
Baltazardounggarris
authored andcommitted
garris#602 - Tagging docker images (garris#617)
* Update Dockerfile and add the build hook to pass the version as argument (extracted from the package.json file) * Add the "post_push" hook (to generate the "latest" image)
1 parent 53b49b8 commit 5022a2e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
FROM node:8.5.0-alpine
22

3+
ARG BACKSTOPJS_VERSION
4+
35
ENV \
46
PHANTOMJS_VERSION=2.1.1 \
57
CASPERJS_VERSION=1.1.4 \
68
SLIMERJS_VERSION=0.10.3 \
7-
BACKSTOPJS_VERSION=3.0.36 \
9+
BACKSTOPJS_VERSION=$BACKSTOPJS_VERSION \
810
# Workaround to fix phantomjs-prebuilt installation errors
911
# See https://github.com/Medium/phantomjs/issues/707
1012
NPM_CONFIG_UNSAFE_PERM=true

docker/hooks/build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
BACKSTOPJS_VERSION=$(grep -Po '(?<="version": ")[^"]*' $(dirname "$0")/../../package.json)
3+
4+
docker build --build-arg BACKSTOPJS_VERSION=$BACKSTOPJS_VERSION -t $IMAGE_NAME .

docker/hooks/post_push

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
docker tag $IMAGE_NAME $DOCKER_REPO:latest
3+
docker push $DOCKER_REPO:latest

0 commit comments

Comments
 (0)