Skip to content

Commit

Permalink
Add cosmopolitan test image for Naev.
Browse files Browse the repository at this point in the history
In theory this could be used to build Naev as an APE binary, using:
https://github.com/jart/cosmopolitan
  • Loading branch information
ProjectSynchro committed May 16, 2024
1 parent d678291 commit 8dc27b4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions naev-cosmopolitan/Dockerfile
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

0 comments on commit 8dc27b4

Please sign in to comment.