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

Improve dockerfile for restore speed #3694

Open
cdhanna opened this issue Oct 2, 2024 · 0 comments
Open

Improve dockerfile for restore speed #3694

cdhanna opened this issue Oct 2, 2024 · 0 comments

Comments

@cdhanna
Copy link
Collaborator

cdhanna commented Oct 2, 2024

COPY services/Serv/Serv.csproj ${BEAM_CSPROJ_PATH}
COPY services/Dato/Dato.csproj /subsrc/services/Dato/Dato.csproj
RUN dotnet restore ${BEAM_CSPROJ_PATH} -p:BeamableVersion=${BEAM_VERSION} -a $TARGETARCH

If you do the dotnet restore as a special pre-step, and then add the --no-restore flag to the publish command, docker can layer-cache the restore, and it only breaks when you're csproj file changes (like adding a nuget reference).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant