Avoid RUNs on the target Dockerfile

This commit is contained in:
Gervasio Marchand 2024-01-01 11:56:48 -03:00
parent 2fbc0744db
commit bd9689f356
No known key found for this signature in database
GPG Key ID: B7736CB188DD0A38
2 changed files with 3 additions and 4 deletions

View File

@ -5,9 +5,8 @@ COPY src /src/
RUN dotnet publish -c Release /src/FakeRelay.sln -o /app RUN dotnet publish -c Release /src/FakeRelay.sln -o /app
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0-alpine3.18-${ARCH} FROM mcr.microsoft.com/dotnet/aspnet:8.0.0-alpine3.18-${ARCH}
VOLUME ["/data"] WORKDIR /app
ENV CONFIG_PATH=/data/config.json ENV CONFIG_PATH=/data/config.json
COPY --from=builder /app /app COPY --from=builder /app /app
COPY entrypoint.sh /app/entrypoint.sh COPY entrypoint.sh /app/entrypoint.sh
RUN ln -s /app/FakeRelay.Cli /bin/cli && ln -s /app/FakeRelay.Web /bin/web && chmod +x /app/entrypoint.sh
ENTRYPOINT [ "/app/entrypoint.sh" ] ENTRYPOINT [ "/app/entrypoint.sh" ]

4
entrypoint.sh Normal file → Executable file
View File

@ -1,7 +1,7 @@
#!/bin/ash #!/bin/ash
if [ "$1" = "web" ]; then if [ "$1" = "web" ]; then
web dotnet FakeRelay.Web.dll
else else
cli "$@" dotnet FakeRelay.Cli.dll "$@"
fi fi