Skip to content

Commit

Permalink
Fix docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
devedse committed Mar 8, 2024
1 parent 3c4f318 commit 6edcd57
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions DeveMultiCompressor.ConsoleApp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ COPY ["DeveMultiCompressor/DeveMultiCompressor.csproj", "DeveMultiCompressor/"]
RUN dotnet restore "DeveMultiCompressor.ConsoleApp/DeveMultiCompressor.ConsoleApp.csproj"
COPY . .
WORKDIR "/src/DeveMultiCompressor.ConsoleApp"
RUN dotnet build "DeveMultiCompressor.ConsoleApp.csproj" -c Release -o /app/build

FROM build AS publish
ARG BUILD_VERSION
ARG VER=${BUILD_VERSION:-1.0.0}
RUN dotnet publish "DeveMultiCompressor.ConsoleApp.csproj" -c Release -o /app/publish /p:Version=$VER

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# Make executable files without extension executable
RUN echo "Making executable files without extension executable..." && \
find . -type f ! -name "*.*" -exec sh -c '\
Expand All @@ -35,4 +26,15 @@ RUN echo "Making executable files without extension executable..." && \
fi; \
done \
' sh {} +

RUN dotnet build "DeveMultiCompressor.ConsoleApp.csproj" -c Release -o /app/build

FROM build AS publish
ARG BUILD_VERSION
ARG VER=${BUILD_VERSION:-1.0.0}
RUN dotnet publish "DeveMultiCompressor.ConsoleApp.csproj" -c Release -o /app/publish /p:Version=$VER

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DeveMultiCompressor.ConsoleApp.dll"]

0 comments on commit 6edcd57

Please sign in to comment.