🔀 Merge branch 'caarlos0-images'

This commit is contained in:
Jan Oberhauser 2021-06-17 14:36:14 +02:00
commit b387196291
6 changed files with 37 additions and 108 deletions

View file

@ -14,3 +14,7 @@ indent_size = 2
[*.ts] [*.ts]
quote_type = single quote_type = single
[*.yml]
indent_style = space
indent_size = 2

View file

@ -1,40 +0,0 @@
name: Docker Image CI - Rpi
on:
push:
tags:
- n8n@*
workflow_dispatch:
inputs:
version:
description: 'n8n version to build docker image for.'
required: true
default: '0.112.0'
jobs:
armv7_job:
runs-on: ubuntu-18.04
name: Build on ARMv7 (Rpi)
steps:
- uses: actions/checkout@v1
- name: Get the version
id: vars
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: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3
with:
buildx-version: latest
qemu-version: latest
- name: Run Buildx (push image)
if: success()
run: |
docker buildx build \
--platform linux/arm/v7 \
--build-arg N8N_VERSION=${{github.event.inputs.version || steps.vars.outputs.tag}} \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:${{github.event.inputs.version || steps.vars.outputs.tag}}-rpi \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:latest-rpi \
--output type=image,push=true docker/images/n8n-rpi

View file

@ -6,33 +6,41 @@ on:
- n8n@* - n8n@*
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Get the version - name: Get the version
id: vars id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:14}) run: echo ::set-output name=tag::$(echo ${GITHUB_REF:14})
- name: Log in to Docker registry - name: Set up QEMU
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
- name: Build the Docker image of version uses: docker/setup-buildx-action@v1
run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}} docker/images/n8n - name: Login to DockerHub
- name: Push Docker image of version uses: docker/login-action@v1
run: docker push n8nio/n8n:${{steps.vars.outputs.tag}} with:
- name: Tag Docker image with latest username: ${{ secrets.DOCKER_USERNAME }}
run: docker tag n8nio/n8n:${{steps.vars.outputs.tag}} n8nio/n8n:latest password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push docker images of latest - name: Build
run: docker push n8nio/n8n:latest uses: docker/build-push-action@v2
with:
- name: Build the Docker image of version (Debian) context: ./docker/images/n8n
run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-debian docker/images/n8n-debian build-args: |
- name: Push Docker image of version (Debian) N8N_VERSION=${{steps.vars.outputs.tag}}
run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-debian platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Tag Docker image with latest (Debian) push: true
run: docker tag n8nio/n8n:${{steps.vars.outputs.tag}}-debian n8nio/n8n:latest-debian tags: |
- name: Push docker images of latest (Debian) ${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}
run: docker push n8nio/n8n:latest-debian ${{ secrets.DOCKER_USERNAME }}/n8n:latest
- name: Build (debian)
uses: docker/build-push-action@v2
with:
context: ./docker/images/n8n-debian
build-args: |
N8N_VERSION=${{ steps.vars.outputs.tag }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}-debian
${{ secrets.DOCKER_USERNAME }}/n8n:latest-debian

View file

@ -1,21 +0,0 @@
FROM arm32v7/node:14.15
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 gosu git
RUN npm_config_user=root npm install -g full-icu n8n@${N8N_VERSION}
ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu
ENV NODE_ENV production
WORKDIR /data
USER root
CMD chown -R node:node /home/node/.n8n \
&& gosu node n8n

View file

@ -1,22 +0,0 @@
## n8n - Raspberry PI Docker Image
Dockerfile to build n8n for Raspberry PI.
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=<VERSION> -t n8nio/n8n:<VERSION> .
# For example:
docker build --build-arg N8N_VERSION=0.43.0 -t n8nio/n8n:0.43.0-rpi .
```
```
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n:0.70.0-rpi
```

View file

@ -227,10 +227,10 @@ docker run -it --rm \
## Build Docker-Image ## Build Docker-Image
``` ```
docker build --build-arg N8N_VERSION=<VERSION> -t n8nio/n8n:<VERSION> . docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg N8N_VERSION=<VERSION> -t n8nio/n8n:<VERSION> .
# For example: # For example:
docker build --build-arg N8N_VERSION=0.18.1 -t n8nio/n8n:0.18.1 . docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg N8N_VERSION=0.114.0 -t n8nio/n8n:0.114.0 .
``` ```