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 .