mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-21 13:29:36 +00:00
6931631adc
Define a docker-entrypoint.sh that checks for the environment variables INTERFACES. If INTERFACES is set to "universal" then we do the following: - If the universal/RIncludes directory is not empty, assume that the Universal interfaces are already installed. Call interfaces-and-libraries.sh to link the Universal interfaces instead of the default multiversal interfaces. - Otherwise check the INTERFACESFILE environment variable to locate a suitable Macbinary DiskCopy image of MPW-GM.img.bin containing the "Interfaces&Libraries" directory, which can be a path within the container image itself or an external URL. If the file is a URL then download it first, then decompress the file using ConvertDiskImage and then use the in-built hfsutils to extract the relevant files under /tmp/InterfacesAndLibraries. Finally call interfaces-and-libraries.sh to link the Universal interfaces instead of the default multiversal interfaces. Otherwise use the multiversal interfaces which are included by default.
44 lines
1.0 KiB
Docker
44 lines
1.0 KiB
Docker
# vim:ft=dockerfile
|
|
|
|
# Base image
|
|
FROM ubuntu:20.04 AS base
|
|
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
cmake libgmp-dev libmpfr-dev libmpc-dev \
|
|
libboost-all-dev bison texinfo \
|
|
ruby flex curl g++ git macutils
|
|
|
|
# Add toolchain to default PATH
|
|
ENV PATH=/Retro68-build/toolchain/bin:$PATH
|
|
WORKDIR /root
|
|
|
|
# Build image
|
|
FROM base AS build
|
|
|
|
ADD . /Retro68
|
|
|
|
RUN mkdir /Retro68-build && \
|
|
mkdir /Retro68-build/bin && \
|
|
bash -c "cd /Retro68-build && bash /Retro68/build-toolchain.bash"
|
|
|
|
# Release image
|
|
FROM base AS release
|
|
|
|
ENV INTERFACES=multiversal
|
|
|
|
COPY --from=build \
|
|
/Retro68/interfaces-and-libraries.sh \
|
|
/Retro68/prepare-headers.sh \
|
|
/Retro68/prepare-rincludes.sh \
|
|
/Retro68/install-universal-interfaces.sh \
|
|
/Retro68/docker-entrypoint.sh \
|
|
/Retro68-build/bin/
|
|
|
|
COPY --from=build /Retro68-build/toolchain /Retro68-build/toolchain
|
|
|
|
LABEL org.opencontainers.image.source https://github.com/autc04/Retro68
|
|
|
|
CMD [ "/bin/bash" ]
|
|
ENTRYPOINT [ "/Retro68-build/bin/docker-entrypoint.sh" ]
|