From b98bcf09f2ec5c7f1bf6e12b9128a6aa848e22e2 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Sun, 11 Dec 2022 23:25:28 +0530 Subject: [PATCH] Avoid soft-lock bug Rust binaries are soft-locking when workdir is set to / Signed-off-by: baalajimaestro --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9cdc130..abf750d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,9 @@ COPY src /app/src COPY templates /app/templates RUN cargo build --release -FROM gcr.io/distroless/cc:nonroot -COPY --from=builder /app/target/release/paste-frontend / -ADD --chmod=005 templates /templates +FROM gcr.io/distroless/cc:latest +WORKDIR /app +COPY --from=builder /app/target/release/paste-frontend /app/paste-frontend +ADD templates /app/templates EXPOSE 8080 -CMD ["/paste-frontend"] +CMD ["./paste-frontend"]