-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cosmopolitan test image for Naev.
In theory this could be used to build Naev as an APE binary, using: https://github.com/jart/cosmopolitan
- Loading branch information
1 parent
d678291
commit 8dc27b4
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Build toolchain in build container to save space. | ||
FROM registry.fedoraproject.org/fedora-minimal:latest AS build | ||
|
||
# Get cosmopolitan release | ||
WORKDIR /tmp | ||
RUN microdnf install -y git unzip | ||
RUN curl -LO https://github.com/jart/cosmopolitan/releases/download/3.3.6/cosmocc-3.3.6.zip && \ | ||
mkdir -p /usr/local/src/cosmocc-3.3.6 && \ | ||
unzip cosmocc-3.3.6.zip -d /usr/local/src/cosmocc-3.3.6 | ||
|
||
# TODO: Attempt building Naev libraries with cosmo toolchain. | ||
|
||
# Build final container | ||
FROM registry.fedoraproject.org/fedora-minimal:latest | ||
|
||
WORKDIR / | ||
COPY --from=build /usr/local/src/cosmocc-3.3.6 /usr/lib/cosmocc | ||
|
||
LABEL org.opencontainers.image.authors "Naev Dev Team" | ||
LABEL org.opencontainers.image.source "https://github.com/naev/naev-infrastructure" | ||
LABEL org.opencontainers.image.description "Used to build using cosmopolitan libc project." | ||
|
||
# Install dependencies for toolchain | ||
RUN microdnf install -y gzip zip unzip | ||
|
||
# Allows for determining what container scripts are run in. | ||
ENV IMAGE_NAME "naev-cosmopolitan" | ||
|
||
# Add CosmoCC to path | ||
ENV PATH "$PATH:/usr/lib/cosmocc/bin" | ||
|
||
# Force appimages to extract to get around a lack of FUSE in docker. (without some ####ery at least.) | ||
ENV APPIMAGE_EXTRACT_AND_RUN 1 | ||
|
||
# Install build tools. | ||
RUN mkdir -p /tmp/naevBuild | ||
WORKDIR /tmp/naevBuild |