From 9ae952815f1aa835d5d82dc9fec9332543b03573 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Tue, 18 Jul 2023 21:02:38 -0400 Subject: [PATCH] Fix flaky cartservice build (#984) * update dotnet builder version * update docker version * fix yaml lint * change builder image * try different qemu container * disable static web assets entirely * fix build issue * split stages and increase loglevel --------- Co-authored-by: Carter Socha <43380952+cartersocha@users.noreply.github.com> --- .github/workflows/build-images.yml | 2 ++ src/cartservice/src/Dockerfile | 10 +++++++--- src/cartservice/src/cartservice.csproj | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 594f68e89f..90218f3345 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -111,6 +111,8 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 + with: + image: tonistiigi/binfmt:master - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 diff --git a/src/cartservice/src/Dockerfile b/src/cartservice/src/Dockerfile index a711986268..ef6343095d 100644 --- a/src/cartservice/src/Dockerfile +++ b/src/cartservice/src/Dockerfile @@ -15,7 +15,7 @@ # limitations under the License. # https://mcr.microsoft.com/v2/dotnet/sdk/tags/list -FROM mcr.microsoft.com/dotnet/sdk:7.0.304 AS builder +FROM mcr.microsoft.com/dotnet/sdk:7.0.306 AS builder WORKDIR /usr/src/app/ @@ -25,8 +25,12 @@ COPY ./pb/ ./src/protos/ RUN \ RUNTIME_IDENTIIFER=linux-musl-x64; \ if [ "$(uname -m)" = "aarch64" ]; then RUNTIME_IDENTIIFER=linux-musl-arm64; fi; \ - dotnet restore ./src/cartservice.csproj -r $RUNTIME_IDENTIIFER && \ - dotnet publish ./src/cartservice.csproj -p:PublishSingleFile=true -r $RUNTIME_IDENTIIFER --self-contained true -p:PublishTrimmed=False -p:TrimMode=Link -c Release -o /cartservice --no-restore + dotnet restore ./src/cartservice.csproj -v d -r $RUNTIME_IDENTIIFER + +RUN \ + RUNTIME_IDENTIIFER=linux-musl-x64; \ + if [ "$(uname -m)" = "aarch64" ]; then RUNTIME_IDENTIIFER=linux-musl-arm64; fi; \ + dotnet publish ./src/cartservice.csproj -v d -p:PublishSingleFile=true -r $RUNTIME_IDENTIIFER --self-contained true -p:PublishTrimmed=False -p:TrimMode=Link -c Release -o /cartservice --no-restore # ----------------------------------------------------------------------------- diff --git a/src/cartservice/src/cartservice.csproj b/src/cartservice/src/cartservice.csproj index 2f6c8c7f5e..df873499dd 100644 --- a/src/cartservice/src/cartservice.csproj +++ b/src/cartservice/src/cartservice.csproj @@ -2,6 +2,8 @@ net7.0 + false + false