Skip to content

Commit c7c3cff

Browse files
authored
Merge pull request #4834 from Particular/john/provenence
Improving provenance of image
2 parents 2c1dea6 + 14c63fd commit c7c3cff

File tree

7 files changed

+73
-63
lines changed

7 files changed

+73
-63
lines changed

.github/workflows/build-containers.yml

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ jobs:
1212
include:
1313
- name: servicecontrol
1414
project: ServiceControl
15-
description: ServiceControl error instance
15+
title: ServiceControl
16+
description: Gather status, performance and monitoring data for multiple endpoints from a single location.
1617
- name: servicecontrol-audit
1718
project: ServiceControl.Audit
18-
description: ServiceControl audit instance
19+
title: ServiceControl Audit Instance
20+
description: Provide valuable information about the message flow through a system.
1921
- name: servicecontrol-monitoring
2022
project: ServiceControl.Monitoring
21-
description: ServiceControl monitoring instance
23+
title: ServiceControl Monitoring Instance
24+
description: Track the health of a distributed system.
2225
fail-fast: false
2326
steps:
2427
- name: Check for secrets
@@ -40,24 +43,44 @@ jobs:
4043
- name: Set up Docker Buildx
4144
uses: docker/[email protected]
4245
- name: Log in to GitHub container registry
43-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
44-
- name: Build & inspect image
45-
env:
46-
TAG_NAME: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || env.MinVerVersion }}
47-
run: |
48-
docker buildx build --push --tag ghcr.io/particular/${{ matrix.name }}:${{ env.TAG_NAME }} \
49-
--file src/${{ matrix.project }}/Dockerfile \
50-
--build-arg VERSION=${{ env.MinVerVersion }} \
51-
--annotation "index:org.opencontainers.image.title=${{ matrix.name }}" \
52-
--annotation "index:org.opencontainers.image.description=${{ matrix.description }}" \
53-
--annotation "index:org.opencontainers.image.created=$(date '+%FT%TZ')" \
54-
--annotation "index:org.opencontainers.image.revision=${{ github.sha }}" \
55-
--annotation "index:org.opencontainers.image.authors=Particular Software" \
56-
--annotation "index:org.opencontainers.image.vendor=Particular Software" \
57-
--annotation "index:org.opencontainers.image.version=${{ env.MinVerVersion }}" \
58-
--annotation "index:org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/${{ github.sha }}" \
59-
--annotation "index:org.opencontainers.image.url=https://hub.docker.com/r/particular/${{ matrix.name }}" \
60-
--annotation "index:org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/" \
61-
--annotation "index:org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-composite-extra" \
62-
--platform linux/arm64,linux/amd64 .
63-
docker buildx imagetools inspect ghcr.io/particular/${{ matrix.name }}:${{ env.TAG_NAME }}
46+
uses: docker/[email protected]
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
- name: Get current date
52+
id: date
53+
run: echo "date=$(date '+%FT%TZ')" >> $GITHUB_OUTPUT
54+
- name: Build and push image to GitHub container registry
55+
uses: docker/[email protected]
56+
with:
57+
context: .
58+
push: true
59+
platforms: linux/amd64,linux/arm64
60+
sbom: true
61+
labels: |
62+
org.opencontainers.image.source=https://github.com/Particular/ServiceControl/tree/${{ github.sha }}
63+
org.opencontainers.image.authors="Particular Software"
64+
org.opencontainers.image.vendor="Particular Software"
65+
org.opencontainers.image.url=https://hub.docker.com/r/particular/${{ matrix.name }}
66+
org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/
67+
org.opencontainers.image.version=${{ env.MinVerVersion }}
68+
org.opencontainers.image.revision=${{ github.sha }}
69+
org.opencontainers.image.created=${{ steps.date.outputs.date }}
70+
org.opencontainers.image.title=${{ matrix.title }}
71+
org.opencontainers.image.description=${{ matrix.description }}
72+
org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-composite-extra
73+
annotations: |
74+
index:org.opencontainers.image.source=https://github.com/Particular/ServiceControl/tree/${{ github.sha }}
75+
index:org.opencontainers.image.authors="Particular Software"
76+
index:org.opencontainers.image.vendor="Particular Software"
77+
index:org.opencontainers.image.url=https://hub.docker.com/r/particular/${{ matrix.name }}
78+
index:org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/
79+
index:org.opencontainers.image.version=${{ env.MinVerVersion }}
80+
index:org.opencontainers.image.revision=${{ github.sha }}
81+
index:org.opencontainers.image.created=${{ steps.date.outputs.date }}
82+
index:org.opencontainers.image.title=${{ matrix.title }}
83+
index:org.opencontainers.image.description=${{ matrix.description }}
84+
index:org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-composite-extra
85+
file: src/${{ matrix.project }}/Dockerfile
86+
tags: ghcr.io/particular/${{ matrix.name }}:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || env.MinVerVersion }}

.github/workflows/build-db-container.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ jobs:
2424
uses: ./.github/actions/validate-version
2525
with:
2626
version: ${{ env.MinVerVersion }}
27+
- name: Set up Docker Buildx
28+
uses: docker/[email protected]
2729
- name: Log in to GitHub container registry
28-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
30+
uses: docker/[email protected]
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
2935
- name: Install Docker arm64 emulation
3036
run: docker run --privileged --rm tonistiigi/binfmt --install arm64
3137
- name: Build images

.github/workflows/container-integration-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ jobs:
5656
- name: Run MinVer
5757
uses: Particular/[email protected]
5858
- name: Log in to GitHub container registry
59-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
59+
uses: docker/login-action@v3
60+
with:
61+
registry: ghcr.io
62+
username: ${{ github.actor }}
63+
password: ${{ secrets.GITHUB_TOKEN }}
6064
- name: Log in to Docker Hub
6165
uses: docker/[email protected]
6266
with:

.github/workflows/push-container-images.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,32 @@ jobs:
2222
with:
2323
version: ${{ inputs.version }}
2424
- name: Log in to GitHub container registry
25-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
25+
uses: docker/[email protected]
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
2630
- name: Login to Docker Hub
2731
uses: docker/[email protected]
2832
with:
2933
username: ${{ secrets.DOCKERHUB_USERNAME }}
3034
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
- name: Set up Docker Buildx
36+
uses: docker/[email protected]
3137
- name: Publish to Docker Hub
3238
run: |
3339
$containers = @('servicecontrol', 'servicecontrol-audit', 'servicecontrol-monitoring', 'servicecontrol-ravendb')
3440
$tags = "${{ steps.validate.outputs.container-tags }}" -Split ','
3541
$sourceTag = "${{ inputs.version }}"
3642
37-
foreach ($tag in $tags)
43+
foreach($name in $containers)
3844
{
39-
foreach($name in $containers)
40-
{
41-
Write-Output "::group::Pushing $($name):$($tag)"
42-
$cmd = "docker buildx imagetools create --tag particular/$($name):$($tag) ghcr.io/particular/$($name):$($sourceTag)"
43-
Write-Output "Command: $cmd"
44-
Invoke-Expression $cmd
45-
Write-Output "::endgroup::"
46-
}
45+
Write-Output "::group::Pushing $name with $tags tags"
46+
$tagsCLI = $tags -replace "^", "--tag particular/${name}:"
47+
$cmd = "docker buildx imagetools create $tagsCLI ghcr.io/particular/${name}:$sourceTag"
48+
Write-Output "Command: $cmd"
49+
Invoke-Expression $cmd
50+
Write-Output "::endgroup::"
4751
}
4852
- name: Update Docker Hub Description - ServiceControl
4953
if: ${{ steps.validate.outputs.latest == 'true' }}

src/ServiceControl.Audit/Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,8 @@ RUN dotnet publish src/HealthCheckApp/HealthCheckApp.csproj --arch $TARGETARCH -
1010

1111
# Runtime image
1212
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-composite-extra
13-
ARG VERSION
1413
WORKDIR /app
1514

16-
LABEL org.opencontainers.image.source=https://github.com/Particular/ServiceControl \
17-
org.opencontainers.image.authors="Particular Software" \
18-
org.opencontainers.image.url=https://docs.particular.net/servicecontrol/ \
19-
org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/ \
20-
org.opencontainers.image.version=$VERSION \
21-
org.opencontainers.image.title=ServiceControl.Audit \
22-
org.opencontainers.image.description="ServiceControl audit instance"
23-
2415
EXPOSE 44444
2516

2617
COPY --from=build /deploy/Particular.ServiceControl.Audit /app

src/ServiceControl.Monitoring/Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,8 @@ RUN dotnet publish src/HealthCheckApp/HealthCheckApp.csproj --arch $TARGETARCH -
1010

1111
# Runtime image
1212
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-composite-extra
13-
ARG VERSION
1413
WORKDIR /app
1514

16-
LABEL org.opencontainers.image.source=https://github.com/Particular/ServiceControl \
17-
org.opencontainers.image.authors="Particular Software" \
18-
org.opencontainers.image.url=https://docs.particular.net/servicecontrol/ \
19-
org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/ \
20-
org.opencontainers.image.version=$VERSION \
21-
org.opencontainers.image.title=ServiceControl.Monitoring \
22-
org.opencontainers.image.description="ServiceControl monitoring instance"
23-
2415
EXPOSE 33633
2516

2617
COPY --from=build /deploy/Particular.ServiceControl.Monitoring /app

src/ServiceControl/Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,8 @@ RUN dotnet publish src/HealthCheckApp/HealthCheckApp.csproj --arch $TARGETARCH -
1010

1111
# Runtime image
1212
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-composite-extra
13-
ARG VERSION
1413
WORKDIR /app
1514

16-
LABEL org.opencontainers.image.source=https://github.com/Particular/ServiceControl \
17-
org.opencontainers.image.authors="Particular Software" \
18-
org.opencontainers.image.url=https://docs.particular.net/servicecontrol/ \
19-
org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/ \
20-
org.opencontainers.image.version=$VERSION \
21-
org.opencontainers.image.title=ServiceControl \
22-
org.opencontainers.image.description="ServiceControl primary instance"
23-
2415
EXPOSE 33333
2516

2617
COPY --from=build /deploy/Particular.ServiceControl /app

0 commit comments

Comments
 (0)