Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: alpine and slim images #14

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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