From 77073127156d9d1c9e215a278c002d3ef97e1803 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jan 2020 13:59:55 -0600 Subject: [PATCH] :whale: Add Ubuntu Docker Image --- .github/workflows/docker-images.yml | 6 ++++++ docker/images/n8n-ubuntu/Dockerfile | 18 ++++++++++++++++++ docker/images/n8n-ubuntu/README.md | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 docker/images/n8n-ubuntu/Dockerfile create mode 100644 docker/images/n8n-ubuntu/README.md diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 8c984b8cc1..8d034b5b91 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -18,6 +18,7 @@ jobs: run: echo ::set-output name=tag::$(echo ${GITHUB_REF:14}) - name: Log in to Docker registry run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + - name: Build the Docker image of version run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}} docker/images/n8n - name: Push Docker image of version @@ -26,3 +27,8 @@ jobs: run: docker tag n8nio/n8n:${{steps.vars.outputs.tag}} n8nio/n8n:latest - name: Push docker images of latest run: docker push n8nio/n8n:latest + + - name: Build the Docker image of version (Ubuntu) + run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu docker/images/n8n-ubuntu + - name: Push Docker image of version (Ubuntu) + run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu diff --git a/docker/images/n8n-ubuntu/Dockerfile b/docker/images/n8n-ubuntu/Dockerfile new file mode 100644 index 0000000000..2b44afe401 --- /dev/null +++ b/docker/images/n8n-ubuntu/Dockerfile @@ -0,0 +1,18 @@ +FROM node:10.16 + +ARG N8N_VERSION + +RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi + +RUN \ + apt-get update && \ + apt-get -y install graphicsmagick + +# Set a custom user to not have n8n run as root +USER root + +RUN npm_config_user=root npm install -g n8n@${N8N_VERSION} + +WORKDIR /data + +CMD "n8n" diff --git a/docker/images/n8n-ubuntu/README.md b/docker/images/n8n-ubuntu/README.md new file mode 100644 index 0000000000..3ee9b5bb69 --- /dev/null +++ b/docker/images/n8n-ubuntu/README.md @@ -0,0 +1,21 @@ +## n8n - Ubuntu Docker Image + +Dockerfile to build n8n with Ubuntu. + +For information about how to run n8n with Docker check the generic +[Docker-Readme](https://github.com/n8n-io/n8n/tree/master/docker/images/n8n/README.md) + + +``` +docker build --build-arg N8N_VERSION= -t n8nio/n8n: . + +# For example: +docker build --build-arg N8N_VERSION=0.43.0 -t n8nio/n8n:0.43.0-ubuntu . +``` + +``` +docker run -it --rm \ + --name n8n \ + -p 5678:5678 \ + n8nio/n8n:0.43.0-ubuntu +```