From 369fbab03f3e2ecf2ab634c2541b5aa981fad60b Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sat, 17 Feb 2024 14:16:06 -0500 Subject: [PATCH] feat: Use tmpfs mount for /tmp and /var (#67) This allows scripts to create as many files as they need in /tmp and /var without having to worry about them being included in the final image. Now the last instruction will only be the ostree container commit --- templates/Containerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/Containerfile b/templates/Containerfile index a5f684a..de88f45 100644 --- a/templates/Containerfile +++ b/templates/Containerfile @@ -72,6 +72,8 @@ COPY {{ src }} {{ dest }} {%- endif %} {%- else %} RUN \ + --mount=type=tmpfs,target=/tmp \ + --mount=type=tmpfs,target=/var \ --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw \ --mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \ --mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \ @@ -81,5 +83,4 @@ RUN \ {%- endif %} {%- endfor %} - -RUN rm -rf /tmp/* /var/* && ostree container commit +RUN ostree container commit