aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-08 01:33:18 -0700
committerFuwn <[email protected]>2024-09-08 01:33:22 -0700
commit3f446b3259ff4709be6bcf9cb67e1e4d21938144 (patch)
treec2161ddc0e061b701965c5f191624c04c1aae1f0 /Dockerfile
parentchore(nix): add direnv (diff)
downloadlocus-3f446b3259ff4709be6bcf9cb67e1e4d21938144.tar.xz
locus-3f446b3259ff4709be6bcf9cb67e1e4d21938144.zip
chore(docker): shrink image
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index cef3617..c4ca302 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,16 +27,17 @@ RUN --mount=type=cache,target=/source/locus/target \
cargo build --release --bin locus \
&& strip -s /source/locus/target/x86_64-unknown-linux-musl/release/locus \
&& mv /source/locus/target/x86_64-unknown-linux-musl/release/locus .
+RUN strip -s /source/locus/locus
+RUN mkdir /new_tmp
-FROM gcr.io/distroless/static:nonroot
+FROM scratch
WORKDIR /locus
COPY --from=build /source/locus/locus .
COPY ./content ./content
-
-# CBA
-USER root
+# https://www.reddit.com/r/docker/comments/8y2zyx/how_to_add_a_empty_directory_to_a_scratch_image/e27oumn/
+COPY +build/new_tmp /tmp
EXPOSE 1965