From ce69b349cfde70003eed5b8270e4dc8caf618dfd Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 10 Aug 2019 00:07:01 +0200 Subject: [PATCH] :whale: Improve automatic docker build --- docker/images/n8n/Dockerfile | 6 +++++- docker/images/n8n/hooks/build | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 docker/images/n8n/hooks/build diff --git a/docker/images/n8n/Dockerfile b/docker/images/n8n/Dockerfile index 96784bbb90..66e67947b9 100644 --- a/docker/images/n8n/Dockerfile +++ b/docker/images/n8n/Dockerfile @@ -1,5 +1,9 @@ FROM mhart/alpine-node:10 +ARG N8N_VERSION + +RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi + # Update everything and install needed dependencies RUN apk add --update \ graphicsmagick @@ -10,7 +14,7 @@ USER root # Install n8n and the also temporary all the packages # it needs to build it correctly. RUN apk --update add --virtual build-dependencies python build-base && \ - npm_config_user=root npm install -g n8n && \ + npm_config_user=root npm install -g n8n@${N8N_VERSION} && \ apk del build-dependencies WORKDIR /data diff --git a/docker/images/n8n/hooks/build b/docker/images/n8n/hooks/build new file mode 100644 index 0000000000..a09c622456 --- /dev/null +++ b/docker/images/n8n/hooks/build @@ -0,0 +1,2 @@ +#!/bin/bash +docker build --build-arg N8N_VERSION=$DOCKER_TAG -f $DOCKERFILE_PATH -t $IMAGE_NAME .