Skip to content

Commit a36bd99

Browse files
committed
RE1-T121 Dockerfile fix
1 parent c2e0bca commit a36bd99

5 files changed

Lines changed: 20 additions & 10 deletions

File tree

Web/Resgrid.Web.Eventing/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ WORKDIR "/src/Web/Resgrid.Web.Eventing"
2626
FROM build AS publish
2727
ARG BUILD_VERSION
2828
RUN dotnet publish "Resgrid.Web.Eventing.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
29-
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /app/publish/wait
29+
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
3030
RUN chmod +x /app/publish/wait
3131

3232
FROM base AS final
3333
WORKDIR /app
3434
COPY --from=publish /app/publish .
35+
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
36+
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".
37+
ENV WAIT_COMMAND="dotnet Resgrid.Web.Eventing.dll"
3538
ENTRYPOINT ["./wait"]
36-
CMD ["dotnet", "Resgrid.Web.Eventing.dll"]

Web/Resgrid.Web.Mcp/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ WORKDIR "/src/Web/Resgrid.Web.Mcp"
3737
FROM build AS publish
3838
ARG BUILD_VERSION
3939
RUN dotnet publish "Resgrid.Web.Mcp.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
40-
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /app/publish/wait
40+
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4141
RUN chmod +x /app/publish/wait
4242

4343
FROM base AS final
4444
WORKDIR /app
4545
COPY --from=publish /app/publish .
46+
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
47+
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".
48+
ENV WAIT_COMMAND="dotnet Resgrid.Web.Mcp.dll"
4649
ENTRYPOINT ["./wait"]
47-
CMD ["dotnet", "Resgrid.Web.Mcp.dll"]

Web/Resgrid.Web.Services/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ WORKDIR "/src/Web/Resgrid.Web.Services"
3737
FROM build AS publish
3838
ARG BUILD_VERSION
3939
RUN dotnet publish "Resgrid.Web.Services.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
40-
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /app/publish/wait
40+
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4141
RUN chmod +x /app/publish/wait
4242

4343
FROM base AS final
4444
WORKDIR /app
4545
COPY --from=publish /app/publish .
46+
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
47+
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".
48+
ENV WAIT_COMMAND="dotnet Resgrid.Web.Services.dll"
4649
ENTRYPOINT ["./wait"]
47-
CMD ["dotnet", "Resgrid.Web.Services.dll"]

Web/Resgrid.Web/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ RUN for i in 1 2 3; do libman restore && break || { echo "libman restore attempt
5555
ENV SKIP_LIBMAN_RESTORE=1
5656
RUN dotnet publish "Resgrid.Web.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
5757
## Download the wait script in the build stage where a shell is available
58-
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /app/publish/wait
58+
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
5959
RUN chmod +x /app/publish/wait
6060

6161
FROM base AS final
6262
WORKDIR /app
6363
COPY --from=publish /app/publish .
64+
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
65+
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".
66+
ENV WAIT_COMMAND="dotnet Resgrid.Web.dll"
6467
ENTRYPOINT ["./wait"]
65-
CMD ["dotnet", "Resgrid.Web.dll"]

Workers/Resgrid.Workers.Console/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ WORKDIR "/src/Workers/Resgrid.Workers.Console"
3737
FROM build AS publish
3838
ARG BUILD_VERSION
3939
RUN dotnet publish "Resgrid.Workers.Console.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
40-
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /app/publish/wait
40+
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4141
RUN chmod +x /app/publish/wait
4242

4343
## Install wkhtmltopdf and capture its runtime libraries
@@ -76,5 +76,7 @@ ENV LD_LIBRARY_PATH="/usr/local/lib/wkhtmltopdf"
7676

7777
COPY --from=publish /app/publish .
7878

79+
# docker-compose-wait waits for WAIT_HOSTS, then execs WAIT_COMMAND.
80+
# These hardened (distroless) images have no shell, so we can't chain with "sh -c".
81+
ENV WAIT_COMMAND="dotnet Resgrid.Workers.Console.dll"
7982
ENTRYPOINT ["./wait"]
80-
CMD ["dotnet", "Resgrid.Workers.Console.dll"]

0 commit comments

Comments
 (0)