Skip to content

Commit

Permalink
Update dotnet-6.0.Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk authored Oct 20, 2023
1 parent c0a0541 commit 5ad0cfe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dockerfiles/dotnet-6.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ COPY codecrafters-redis.csproj /app/codecrafters-redis.csproj
COPY codecrafters-redis.sln /app/codecrafters-redis.sln

RUN mkdir /app/src
RUN echo 'System.Console.WriteLine("Hello World 2!");' > /app/src/Program.cs
RUN echo 'System.Console.WriteLine("If you are seeing this, there is something wrong with our caching mechanism! Please contact us at hello@codecrafters.io.");' > /app/src/Program.cs

WORKDIR /app

RUN dotnet run --project . --configuration Release "$@" # This saves nuget packages to ~/.nuget
RUN rm /app/src/Program.cs

RUN mkdir /app-cached
RUN mv /app/obj /app-cached/obj
RUN mv /app/bin /app-cached/bin
# This seems to cause a caching issue with the dotnet build command, where contents from the removed /src/Program.cs are used
# RUN mkdir /app-cached
# RUN mv /app/obj /app-cached/obj
# RUN mv /app/bin /app-cached/bin

RUN echo "cd \${CODECRAFTERS_SUBMISSION_DIR} && dotnet build --configuration Release ." > /codecrafters-precompile.sh
RUN chmod +x /codecrafters-precompile.sh
Expand Down

0 comments on commit 5ad0cfe

Please sign in to comment.