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
This commit is contained in:
Gerald Pinder 2024-02-17 14:16:06 -05:00 committed by GitHub
parent 98398788f7
commit 369fbab03f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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