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

Simplify cartservice Dockerfile #1308

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
12 changes: 3 additions & 9 deletions src/cartservice/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ WORKDIR /usr/src/app/
COPY ./src/cartservice/ ./
COPY ./pb/ ./src/protos/

RUN \
RUNTIME_IDENTIIFER=linux-musl-x64; \
if [ "${TARGETARCH}" = "arm64" ]; then RUNTIME_IDENTIIFER=linux-musl-arm64; fi; \
dotnet restore ./src/cartservice.csproj -v d -r $RUNTIME_IDENTIIFER

RUN \
RUNTIME_IDENTIIFER=linux-musl-x64; \
if [ "${TARGETARCH}" = "arm64" ]; 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
RUN dotnet restore ./src/cartservice.csproj -v d -r linux-musl-$TARGETARCH

RUN dotnet publish ./src/cartservice.csproj -v d -r linux-musl-$TARGETARCH --no-restore -o /cartservice

# -----------------------------------------------------------------------------

Expand Down
3 changes: 3 additions & 0 deletions src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<TargetFramework>net8.0</TargetFramework>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading