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

Reduce docker image size #1093

Merged
merged 2 commits into from
Feb 12, 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
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ FROM ghcr.io/vmelnalksnis/gnomeshade-build:8.0.101 AS build
WORKDIR /gnomeshade
COPY ./ ./
ARG BUILD_NUMBER=123
RUN ./deployment/publish.sh "Gnomeshade.WebApi" "linux-musl-x64" $BUILD_NUMBER
RUN --mount=type=cache,target=/root/.nuget/packages \
./deployment/publish.sh "Gnomeshade.WebApi" "linux-musl-x64" $BUILD_NUMBER

FROM mcr.microsoft.com/dotnet/runtime-deps:8.0.1-alpine3.18 as gnomeshade

WORKDIR /gnomeshade
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/Gnomeshade.WebApi ./
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/libe_sqlite3.so ./
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/appsettings.json ./
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/*.xml ./
COPY --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/wwwroot/ ./wwwroot
RUN chmod -R -w *
COPY --chmod=-w --from=build [ \
"/gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/Gnomeshade.WebApi", \
"/gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/libe_sqlite3.so", \
"/gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/appsettings.json", \
"/gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/*.xml", \
"./" ]

COPY --chmod=-w --from=build /gnomeshade/source/Gnomeshade.WebApi/bin/Release/net8.0/linux-musl-x64/publish/wwwroot/ ./wwwroot

ENV DOTNET_gcServer=0 \
Database__Provider="Sqlite" \
Expand Down
11 changes: 8 additions & 3 deletions docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<main id="top" class="content">
<h1>Changelog</h1>
<section id="unreleased" hidden="hidden">
<section id="unreleased">
<div>
<a style="display: inline" href="#unreleased"><img src="link.png" alt="link"/></a>
<h2 style="display: inline">Unreleased</h2>
Expand All @@ -71,9 +71,14 @@ <h3>Removed</h3>
<ul></ul>
</section>

<section id="unreleased_fixed" hidden="hidden">
<section id="unreleased_fixed">
<h3>Fixed</h3>
<ul></ul>
<ul>
<li>
Docker image size regression in
<a href="https://github.com/VMelnalksnis/Gnomeshade/pull/1093">#1093</a>
</li>
</ul>
</section>

<section id="unreleased_security" hidden="hidden">
Expand Down
Loading