summaryrefslogtreecommitdiff
path: root/Containerfile
diff options
context:
space:
mode:
authorKyle Gospodnetich <me@kylegospodneti.ch>2025-03-22 15:18:22 -0700
committerGitHub <noreply@github.com>2025-03-22 18:18:22 -0400
commit6382bb38313ca960f51ce6cf24eb5ac75a87d9d6 (patch)
treeb7cceb30f1825dbc7c13e069cbd9710e2930f368 /Containerfile
parent6267a70bca612e9a8f3f0c671d4b9b3880f0ee7c (diff)
downloadAeroCore-OS-6382bb38313ca960f51ce6cf24eb5ac75a87d9d6.tar.gz
AeroCore-OS-6382bb38313ca960f51ce6cf24eb5ac75a87d9d6.zip
feat: Avoid copying build files into image, add option for linting (#93)
Diffstat (limited to 'Containerfile')
-rw-r--r--Containerfile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Containerfile b/Containerfile
index 015dfaf..69550ff 100644
--- a/Containerfile
+++ b/Containerfile
@@ -1,3 +1,8 @@
+# Allow build scripts to be referenced without being copied into the final image
+FROM scratch AS ctx
+COPY build_files /
+
+# Base Image
FROM ghcr.io/ublue-os/bazzite:stable
## Other possible base images include:
@@ -13,11 +18,14 @@ FROM ghcr.io/ublue-os/bazzite:stable
## make modifications desired in your image and install packages by modifying the build.sh script
## the following RUN directive does all the things required to run "build.sh" as recommended.
-COPY build.sh /tmp/build.sh
-
-RUN --mount=type=cache,dst=/var/cache \
+RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
+ --mount=type=cache,dst=/var/cache \
--mount=type=cache,dst=/var/log \
--mount=type=tmpfs,dst=/tmp \
- /tmp/build.sh && \
+ /ctx/build.sh && \
ostree container commit
+### LINTING
+## Verify final image and contents are correct.
+## This can be quite sensitive, so it's disabled by default.
+# RUN bootc container lint \ No newline at end of file