feat: docker images

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-04-05 09:21:58 -03:00
parent 9560dd6ce2
commit 4d3ff091aa
6 changed files with 28 additions and 100 deletions

View file

@ -13,3 +13,7 @@ indent_size = 2
[*.ts]
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

@ -19,20 +19,27 @@ jobs:
- 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: 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
run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}
- name: Tag Docker image with latest
run: docker tag n8nio/n8n:${{steps.vars.outputs.tag}} n8nio/n8n:latest
- name: Push docker images of latest
run: docker push n8nio/n8n:latest
if: success()
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
--build-arg N8N_VERSION=${{steps.vars.outputs.tag}} \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:${{steps.vars.outputs.tag}} \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:latest \
--output type=image,push=true docker/images/n8n
- name: Build the Docker image of version (Debian)
run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-debian docker/images/n8n-debian
- name: Push Docker image of version (Debian)
run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-debian
- name: Tag Docker image with latest (Debian)
run: docker tag n8nio/n8n:${{steps.vars.outputs.tag}}-debian n8nio/n8n:latest-debian
- name: Push docker images of latest (Debian)
run: docker push n8nio/n8n:latest-debian
run: |
docker buildx build \
--platform linux/amd64 \
--build-arg N8N_VERSION=${{steps.vars.outputs.tag}} \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:${{steps.vars.outputs.tag}}-debian \
-t ${{ secrets.DOCKER_USERNAME }}/n8n:latest-debian \
--output type=image,push=true docker/images/n8n-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
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

@ -226,10 +226,10 @@ docker run -it --rm \
## 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:
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 .
```