Skip to content

Commit 57efed6

Browse files
authored
Merge pull request #397 from Resgrid/develop
RE1-T121 Dockerfile fix
2 parents b712e99 + 749bbc6 commit 57efed6

5 files changed

Lines changed: 25 additions & 10 deletions

File tree

Web/Resgrid.Web.Eventing/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7
12
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
23
ARG BUILD_VERSION=3.5.0
34

@@ -26,11 +27,13 @@ WORKDIR "/src/Web/Resgrid.Web.Eventing"
2627
FROM build AS publish
2728
ARG BUILD_VERSION
2829
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
30+
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
3031
RUN chmod +x /app/publish/wait
3132

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

Web/Resgrid.Web.Mcp/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7
12
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
23

34
ARG BUILD_VERSION=3.5.0
@@ -37,11 +38,13 @@ WORKDIR "/src/Web/Resgrid.Web.Mcp"
3738
FROM build AS publish
3839
ARG BUILD_VERSION
3940
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
41+
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4142
RUN chmod +x /app/publish/wait
4243

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

Web/Resgrid.Web.Services/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7
12
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
23

34
ARG BUILD_VERSION=3.5.0
@@ -37,11 +38,13 @@ WORKDIR "/src/Web/Resgrid.Web.Services"
3738
FROM build AS publish
3839
ARG BUILD_VERSION
3940
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
41+
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4142
RUN chmod +x /app/publish/wait
4243

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

Web/Resgrid.Web/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7
12
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
23
ARG BUILD_VERSION=3.5.0
34

@@ -55,11 +56,13 @@ RUN for i in 1 2 3; do libman restore && break || { echo "libman restore attempt
5556
ENV SKIP_LIBMAN_RESTORE=1
5657
RUN dotnet publish "Resgrid.Web.csproj" -c Release -o /app/publish -p:Version=${BUILD_VERSION}
5758
## 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
59+
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
5960
RUN chmod +x /app/publish/wait
6061

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

Workers/Resgrid.Workers.Console/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7
12
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
23
ARG BUILD_VERSION=3.5.0
34

@@ -37,7 +38,7 @@ WORKDIR "/src/Workers/Resgrid.Workers.Console"
3738
FROM build AS publish
3839
ARG BUILD_VERSION
3940
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
41+
ADD --checksum=sha256:2241be671073520e028b2f12df1e9ef0419014cffb5670b7a80b2080804be17d https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait /app/publish/wait
4142
RUN chmod +x /app/publish/wait
4243

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

7778
COPY --from=publish /app/publish .
7879

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

0 commit comments

Comments
 (0)