diff --git a/build-all b/build-all index ccbd568..c2dd1ff 100755 --- a/build-all +++ b/build-all @@ -59,6 +59,7 @@ build_simple() { : \ && build cosmo-awk \ && build cosmo-dist \ && build cosmo-sed \ + && build rescue \ `# phase 4` \ && build cosmo-base \ && build_simple \ diff --git a/cosmo-bootstrap/Dockerfile b/cosmo-bootstrap/Dockerfile index 73097ce..eb741f0 100644 --- a/cosmo-bootstrap/Dockerfile +++ b/cosmo-bootstrap/Dockerfile @@ -81,6 +81,8 @@ RUN --mount=type=tmpfs,target=/tmp : \ b//mkdir.com b//package.com b//pwd.com \ b//rm.com b//touch.com b//unbundle.com \ b//zipobj.com \ +# install the newly-built ape loader, just in case it has changed: \ + && ./expand install -m0755 a//ape.elf /usr/bin/ape \ ; # optionally use the newly-built bootstrapped binaries to build themselves again. diff --git a/rescue/Dockerfile b/rescue/Dockerfile new file mode 100644 index 0000000..de080ae --- /dev/null +++ b/rescue/Dockerfile @@ -0,0 +1,4 @@ +FROM scratch +COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox +COPY --chmod=0755 --from=localhost/cosmo-bootstrap /usr/bin/ape /bin/ape +ENTRYPOINT ["/bin/busybox"] diff --git a/simple/assimilate.Dockerfile b/simple/assimilate.Dockerfile index c55e842..280d7ab 100644 --- a/simple/assimilate.Dockerfile +++ b/simple/assimilate.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/assimilate.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/assimilate.com"] diff --git a/simple/bd.Dockerfile b/simple/bd.Dockerfile index 1cb5ea2..8a56f07 100644 --- a/simple/bd.Dockerfile +++ b/simple/bd.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/bd.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/bd.com"] diff --git a/simple/bing.Dockerfile b/simple/bing.Dockerfile index 7ae1f63..34417df 100644 --- a/simple/bing.Dockerfile +++ b/simple/bing.Dockerfile @@ -1,6 +1,4 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/bing.* /bin/ COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/unbing.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/bing.com"] diff --git a/simple/blinkenlights.Dockerfile b/simple/blinkenlights.Dockerfile index fe0ad24..8c3b77b 100644 --- a/simple/blinkenlights.Dockerfile +++ b/simple/blinkenlights.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/blinkenlights.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/blinkenlights.com"] diff --git a/simple/cosmo-chibicc.Dockerfile b/simple/cosmo-chibicc.Dockerfile index 9298d59..35bcd39 100644 --- a/simple/cosmo-chibicc.Dockerfile +++ b/simple/cosmo-chibicc.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/chibicc.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/chibicc.com"] diff --git a/simple/cosmo-lua.Dockerfile b/simple/cosmo-lua.Dockerfile index 5322db0..6a0eec5 100644 --- a/simple/cosmo-lua.Dockerfile +++ b/simple/cosmo-lua.Dockerfile @@ -1,6 +1,4 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/lua.* /bin/ COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/luac.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/lua.com"] diff --git a/simple/cosmo-make.Dockerfile b/simple/cosmo-make.Dockerfile index 12e2406..a5ffbf4 100644 --- a/simple/cosmo-make.Dockerfile +++ b/simple/cosmo-make.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/make.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/make.com"] diff --git a/simple/cosmo-python.Dockerfile b/simple/cosmo-python.Dockerfile index 9b0601a..afee2a0 100644 --- a/simple/cosmo-python.Dockerfile +++ b/simple/cosmo-python.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/python.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/python.com"] diff --git a/simple/cosmo-sqlite.Dockerfile b/simple/cosmo-sqlite.Dockerfile index f0c5606..ae59993 100644 --- a/simple/cosmo-sqlite.Dockerfile +++ b/simple/cosmo-sqlite.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/sqlite3.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/sqlite3.com"] diff --git a/simple/fold.Dockerfile b/simple/fold.Dockerfile index a25b15c..4485d29 100644 --- a/simple/fold.Dockerfile +++ b/simple/fold.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/fold.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/fold.com"] diff --git a/simple/greenbean.Dockerfile b/simple/greenbean.Dockerfile index fd60e93..1cc49c9 100644 --- a/simple/greenbean.Dockerfile +++ b/simple/greenbean.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/greenbean.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/greenbean.com"] diff --git a/simple/life.Dockerfile b/simple/life.Dockerfile index c5ee855..cb0d7ec 100644 --- a/simple/life.Dockerfile +++ b/simple/life.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/life.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/life.com"] diff --git a/simple/memzoom.Dockerfile b/simple/memzoom.Dockerfile index 57dcf48..cbac391 100644 --- a/simple/memzoom.Dockerfile +++ b/simple/memzoom.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/memzoom.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/memzoom.com"] diff --git a/simple/mkdeps.Dockerfile b/simple/mkdeps.Dockerfile index 8c1dff6..9a39899 100644 --- a/simple/mkdeps.Dockerfile +++ b/simple/mkdeps.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/mkdeps.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/mkdeps.com"] diff --git a/simple/pledge.Dockerfile b/simple/pledge.Dockerfile index 21ca406..3a971cf 100644 --- a/simple/pledge.Dockerfile +++ b/simple/pledge.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/pledge.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/pledge.com"] diff --git a/simple/printimage.Dockerfile b/simple/printimage.Dockerfile index 93c7164..821653a 100644 --- a/simple/printimage.Dockerfile +++ b/simple/printimage.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/printimage.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/printimage.com"] diff --git a/simple/printvideo.Dockerfile b/simple/printvideo.Dockerfile index 4959fe9..70cc442 100644 --- a/simple/printvideo.Dockerfile +++ b/simple/printvideo.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/printvideo.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/printvideo.com"] diff --git a/simple/quickjs.Dockerfile b/simple/quickjs.Dockerfile index 5c43a78..7398e2e 100644 --- a/simple/quickjs.Dockerfile +++ b/simple/quickjs.Dockerfile @@ -1,6 +1,4 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/qjs.* /bin/ COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/qjsc.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/qjs.com"] diff --git a/simple/redbean.Dockerfile b/simple/redbean.Dockerfile index 8b131fc..4574ab5 100644 --- a/simple/redbean.Dockerfile +++ b/simple/redbean.Dockerfile @@ -1,6 +1,4 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/redbean-demo.* /bin/ COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/redbean-original.* /bin/ COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/redbean-static.* /bin/ diff --git a/simple/tinyemu.Dockerfile b/simple/tinyemu.Dockerfile index f84d398..b6462a9 100644 --- a/simple/tinyemu.Dockerfile +++ b/simple/tinyemu.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/tinyemu.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/tinyemu.com"] diff --git a/simple/unbourne.Dockerfile b/simple/unbourne.Dockerfile index 1ad49c7..9644679 100644 --- a/simple/unbourne.Dockerfile +++ b/simple/unbourne.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch AS runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/unbourne.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/unbourne.com"] diff --git a/simple/unveil.Dockerfile b/simple/unveil.Dockerfile index de48f09..38371f8 100644 --- a/simple/unveil.Dockerfile +++ b/simple/unveil.Dockerfile @@ -1,5 +1,3 @@ -FROM scratch as runner -COPY --chmod=0755 --from=localhost/notwa-util /nu/busybox /bin/busybox -COPY --chmod=0755 --from=localhost/cosmo-all /cosmopolitan/build/bootstrap/ape.elf /bin/ape +FROM rescue COPY --chmod=0755 --from=localhost/cosmo-all /usr/local/bin/unveil.* /bin/ ENTRYPOINT ["/bin/ape", "/bin/unveil.com"]