From 46aa9710ee4f5a758b294cf9500533d3e2563310 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Wed, 1 Jan 2020 14:15:15 +0100 Subject: [PATCH] docker alpine test --- .github/workflows/blank.yml | 112 ++++++++++++------------- docker/alpine/Dockerfile.build | 12 ++- docker/debian-stretch/Dockerfile.build | 6 +- 3 files changed, 69 insertions(+), 61 deletions(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index e73d7505..ef7c77ea 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -29,62 +29,62 @@ jobs: with: name: pigallery2-release path: release -# build-alpine: -# runs-on: [ubuntu-latest] -# needs: [create-release] -# steps: -# - -# name: Set tag -# id: vars -# run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) && echo ::set-output name=type::$(echo ${GITHUB_REF:5}) -# - -# name: Checkout -# uses: actions/checkout@v1 -# - -# uses: actions/download-artifact@v1 -# with: -# name: pigallery2-release -# - -# name: Set up Docker Buildx -# id: buildx -# uses: crazy-max/ghaction-docker-buildx@v1 -# with: -# version: latest -# - -# name: Available platforms -# run: echo ${{ steps.buildx.outputs.platforms }} -# - -# name: Docker login -# run: | -# docker login -u "${DOCKER_REGISTRY_USERNAME}" -p "${DOCKER_REGISTRY_PASSWORD}" -# env: -# DOCKER_REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} -# DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} -# - -# name: Run Buildx alpine -# if: startsWith(steps.vars.outputs.type , 'head') -# run: | -# docker buildx build \ -# --platform linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 \ -# --output "type=image,push=true" \ -# --tag bpatrik/pigallery2:nightly-alpine \ -# --file docker/alpine/Dockerfile.build . -# - name: Run Buildx alpine for tag -# if: startsWith(steps.vars.outputs.type , 'tag') -# env: -# RELEASE_VERSION: ${{ steps.vars.outputs.tag }} -# run: | -# docker buildx build \ -# --platform linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 \ -# --output "type=image,push=true" \ -# --tag bpatrik/pigallery2:nightly-alpine \ -# --tag bpatrik/pigallery2:$RELEASE_VERSION-alpine \ -# --tag bpatrik/pigallery2:latest-alpine \ -# --file docker/alpine/Dockerfile.build . -# - -# name: Docker logout -# run: | -# docker logout + build-alpine: + runs-on: [ubuntu-latest] + needs: [create-release] + steps: + - + name: Set tag + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) && echo ::set-output name=type::$(echo ${GITHUB_REF:5}) + - + name: Checkout + uses: actions/checkout@v1 + - + uses: actions/download-artifact@v1 + with: + name: pigallery2-release + - + name: Set up Docker Buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v1 + with: + version: latest + - + name: Available platforms + run: echo ${{ steps.buildx.outputs.platforms }} + - + name: Docker login + run: | + docker login -u "${DOCKER_REGISTRY_USERNAME}" -p "${DOCKER_REGISTRY_PASSWORD}" + env: + DOCKER_REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + - + name: Run Buildx alpine + if: startsWith(steps.vars.outputs.type , 'head') + run: | + docker buildx build \ + --platform linux/amd64,linux/arm64,linux/arm/v7 \ + --output "type=image,push=true" \ + --tag bpatrik/pigallery2:nightly-alpine \ + --file docker/alpine/Dockerfile.build . + - name: Run Buildx alpine for tag + if: startsWith(steps.vars.outputs.type , 'tag') + env: + RELEASE_VERSION: ${{ steps.vars.outputs.tag }} + run: | + docker buildx build \ + --platform linux/amd64,linux/arm64,linux/arm/v7 \ + --output "type=image,push=true" \ + --tag bpatrik/pigallery2:nightly-alpine \ + --tag bpatrik/pigallery2:$RELEASE_VERSION-alpine \ + --tag bpatrik/pigallery2:latest-alpine \ + --file docker/alpine/Dockerfile.build . + - + name: Docker logout + run: | + docker logout build-stretch: runs-on: [ubuntu-latest] needs: [create-release] diff --git a/docker/alpine/Dockerfile.build b/docker/alpine/Dockerfile.build index f4003a8a..b3d97b22 100644 --- a/docker/alpine/Dockerfile.build +++ b/docker/alpine/Dockerfile.build @@ -1,5 +1,7 @@ -FROM node:12-alpine3.10 AS builder -RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community/ \ +#-----------------BUILDER----------------- +#----------------------------------------- +FROM node:12-alpine3.11 AS builder +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.11/community/ \ python build-base sqlite-dev sqlite-libs vips-dev fftw-dev gcc g++ make libc6-compat COPY pigallery2-release /app WORKDIR /app @@ -10,7 +12,9 @@ RUN mkdir -p /app/data/config && \ mkdir -p /app/data/tmp -FROM node:12-alpine3.10 +#-----------------MAIN-------------------- +#----------------------------------------- +FROM node:12-alpine3.11 as main WORKDIR /app # command line arg orverride the config.json with these settings ENTRYPOINT ["node", "./src/backend/index", \ @@ -22,7 +26,7 @@ ENTRYPOINT ["node", "./src/backend/index", \ "--Server-Media-tempFolder=/app/data/tmp"] EXPOSE 80 ENV NODE_ENV=production -RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community/ \ +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.11/community/ \ vips ffmpeg COPY --from=builder /app /app VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"] diff --git a/docker/debian-stretch/Dockerfile.build b/docker/debian-stretch/Dockerfile.build index a338aa28..10af8108 100644 --- a/docker/debian-stretch/Dockerfile.build +++ b/docker/debian-stretch/Dockerfile.build @@ -1,3 +1,5 @@ +#-----------------BUILDER----------------- +#----------------------------------------- FROM node:12-stretch AS builder COPY pigallery2-release /app WORKDIR /app @@ -8,7 +10,9 @@ RUN mkdir -p /app/data/config && \ mkdir -p /app/data/tmp -FROM node:12-stretch-slim +#-----------------MAIN-------------------- +#----------------------------------------- +FROM node:12-stretch-slim as main WORKDIR /app # command line arg orverride the config.json with these settings ENTRYPOINT ["node", "./src/backend/index", \