Skip to content

Commit

Permalink
Merge pull request #14 from mbwhite/docker_variants
Browse files Browse the repository at this point in the history
feat: alpine and slim images
  • Loading branch information
mbwhite authored Aug 21, 2024
2 parents dd81fe6 + 35e3ca7 commit 96e11b0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,26 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.onviffmqtt.outputs.tags }}
labels: ${{ steps.onviffmqtt.outputs.labels }}

id: onviffmqtt
uses: docker/metadata-action@v3
with:
images: ghcr.io/ampretia/onviffmqtt
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}-alpine
type=semver,pattern={{major}}.{{minor}}-alpine
type=semver,pattern={{major}}-alpine
type=sha
- name: build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: VARIANT=alpine
tags: ${{ steps.onviffmqtt.outputs.tags }}
labels: ${{ steps.onviffmqtt.outputs.labels }}
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#
# SPDX-License-Identifier: Apache-2.0
#
FROM node:20 AS builder

ARG VARIANT="slim"

FROM node:20-${VARIANT} AS builder

WORKDIR /usr/src/app

Expand All @@ -10,7 +13,7 @@ COPY --chown=node:node . /usr/src/app
RUN npm ci && npm run build && npm shrinkwrap


FROM node:20 AS production
FROM node:20-${VARIANT} AS production


WORKDIR /usr/src/app
Expand Down

0 comments on commit 96e11b0

Please sign in to comment.