mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
build: don't use context for building Docker image
Use a provided VERSION argument to override the one in the Makefile.
This commit is contained in:
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -238,6 +238,10 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
echo version=$(make version) >> "$GITHUB_OUTPUT"
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/metadata-action@v5
|
||||
@@ -256,9 +260,9 @@ jobs:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/build-push-action@v6
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
platforms: |
|
||||
linux/amd64
|
||||
@@ -266,6 +270,8 @@ jobs:
|
||||
linux/arm64
|
||||
linux/arm/v7
|
||||
push: true
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
|
||||
@@ -18,6 +18,7 @@ RUN touch console/frontend/node_modules console/data/frontend .fmt-js~ .fmt.go~
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
ARG VERSION
|
||||
RUN make
|
||||
|
||||
FROM gcr.io/distroless/static:latest
|
||||
|
||||
@@ -4,7 +4,7 @@ RUN echo filter-syscalls = false >> /etc/nix/nix.conf
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN mkdir -p /output/store
|
||||
RUN git describe --tags --always --dirty --match=v* > .version && git add -f .version
|
||||
RUN make version > .version && git add -f .version
|
||||
RUN nix run ".#update" \
|
||||
&& nix run ".#build" \
|
||||
&& cp -va $(nix-store -qR result) /output/store \
|
||||
|
||||
Reference in New Issue
Block a user