Skip to content

Commit 3a7f17c

Browse files
committed
Use experimental Docker builder for proper versioning
1 parent 1ca3176 commit 3a7f17c

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

.github/workflows/docker.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
name: Docker
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
5-
branches: [ main ]
8+
branches:
9+
- 'main'
10+
tags:
11+
- '4.*'
12+
pull_request:
613

714
jobs:
8-
build-and-push:
9-
runs-on: ubuntu-latest
10-
11-
name: Container Image
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: mback2k/action-docker-package@master
15-
with:
16-
registry_username: ${{ github.repository_owner }}
17-
registry_password: ${{ secrets.GITHUB_TOKEN }}
15+
build:
16+
uses: docker/github-builder-experimental/.github/workflows/build.yml@main
17+
permissions:
18+
contents: read # to fetch the repository content
19+
id-token: write # for signing attestation(s) with GitHub OIDC Token
20+
packages: write # for pushing the container image
21+
with:
22+
output: image
23+
push: ${{ github.event_name != 'pull_request' }}
24+
platforms: linux/amd64
25+
build-args: |
26+
DOCKER_METADATA_OUTPUT_VERSION
27+
meta-images: |
28+
ghcr.io/tkcert/assemblyline-service-vmray
29+
meta-tags: |
30+
type=pep440,pattern={{version}}
31+
type=ref,event=branch
32+
type=ref,event=pr
33+
secrets:
34+
registry-auths: |
35+
- registry: ghcr.io
36+
username: ${{ github.repository_owner }}
37+
password: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG branch=stable
22
FROM cccs/assemblyline-v4-service-base:$branch
33

44
# Python path to the service class from your service directory
5-
ENV SERVICE_PATH vmray_service.VMRayService
5+
ENV SERVICE_PATH=vmray_service.VMRayService
66

77
# Install apt dependencies
88
USER root
@@ -25,9 +25,9 @@ RUN pip install --no-cache-dir --user --requirement requirements.txt && \
2525
rm -rf ~/.cache/pip
2626

2727
# Patch version in manifest
28-
ARG version=4.5.1.dev1
28+
ARG DOCKER_METADATA_OUTPUT_VERSION=4.5.1.dev1
2929
USER root
30-
RUN sed -i -e "s/\$SERVICE_TAG/$version/g" service_manifest.yml
30+
RUN sed -i -e "s/\$SERVICE_TAG/$DOCKER_METADATA_OUTPUT_VERSION/g" service_manifest.yml
3131

3232
# Switch to assemblyline user
3333
USER assemblyline

0 commit comments

Comments
 (0)