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

fix(image-build): change from emulation to cross-compile #29

Merged
merged 1 commit into from
Jun 24, 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
3 changes: 0 additions & 3 deletions .github/workflows/migrations-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

# Create SemVer or ref tags dependent of trigger event
- name: Docker meta
id: meta
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release_candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/service-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile-registry-migrations
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS publish
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS publish
ARG TARGETARCH
WORKDIR /
COPY LICENSE NOTICE.md DEPENDENCIES /
COPY /src/database /src/database
WORKDIR /src/database/SsiAuthoritySchemaRegistry.Migrations
RUN dotnet publish "SsiAuthoritySchemaRegistry.Migrations.csproj" -c Release -o /migrations/publish

FROM base AS final
FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine
ENV COMPlus_EnableDiagnostics=0
WORKDIR /migrations
COPY --from=publish /migrations/publish .
Expand Down
12 changes: 6 additions & 6 deletions docker/Dockerfile-registry-service
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS publish
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS publish
ARG TARGETARCH
WORKDIR /
COPY LICENSE NOTICE.md DEPENDENCIES /
COPY src/ src/
WORKDIR /src/registry/SsiAuthoritySchemaRegistry.Service
RUN dotnet publish "SsiAuthoritySchemaRegistry.Service.csproj" -c Release -o /app/publish

FROM base AS final
ENV COMPlus_EnableDiagnostics=0
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
ENV \
COMPlus_EnableDiagnostics=0 \
ASPNETCORE_URLS=http://+:8080
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_URLS http://+:8080
EXPOSE 8080
RUN chown -R 1000:3000 /app
USER 1000:3000
Expand Down