From e6a974a2a7177c1fcd51e7fdf1ee7c04a062c4bf Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Sat, 12 Feb 2022 09:36:04 -0800 Subject: [PATCH] Fix for maiko buildReleaseInclDocker workflow failures. Dockerfile out of sync. (#416) * Adding new workflow that builds maiko releaases for Linux/amd64, Linux/arm64, Linux/arm7, Macos/amd64. (Not Macos/arm64 as yet.) Also builds and pushes to DockerHub docker images for Linux/amd64 and Linux/arm64. Delete old buildDocker.yml workflow. * Adding latest version of buildReleaseInclDocker.yml; builds release and docker images for all major platforms except MacOs arm64. * Adding Dockerfile. Was out of sync with final dev version at fghalasz/maiko --- Dockerfile | 63 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2a9f2e..8909cf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,55 @@ +#******************************************************************************* +# +# Dockerfile to build Maiko (Stage 1) and create a Docker image and push it +# to DockerHub (stage 2). +# +# Copyright 2022 by Interlisp.org +# +# ****************************************************************************** + +# +# Build Maiko Stage +# +FROM ubuntu:focal AS builder +SHELL ["/bin/bash", "-c"] +USER root:root +# Install build tools +RUN apt-get update && apt-get install -y make clang libx11-dev gcc x11vnc xvfb +# Copy over / clean maiko repo +COPY . /app/maiko +RUN rm -rf /app/maiko/linux* +# Build maiko +WORKDIR /app/maiko/bin +RUN ./makeright x +RUN if [ "$(./osversion)" = "linux" ] && [ "$(./machinetype)" = "x86_64" ]; then ./makeright init; fi +# Prep for Install Stage +RUN mv ../$(./osversion).$(./machinetype) ../TRANSFER +# +# Install Maiko Stage +# FROM ubuntu:focal -ARG BUILD_DATE +ARG BUILD_DATE="not_available" +ARG RELEASE_TAG="not_available" LABEL name="Maiko" LABEL description="Virtual machine for Interlisp Medley" LABEL url="https://github.com/Interlisp/maiko" LABEL build-time=$BUILD_DATE - -ARG TARGETPLATFORM - -RUN apt-get update && apt-get install -y make clang libx11-dev gcc x11vnc xvfb - -COPY --chown=nonroot:nonroot . /app/maiko -RUN rm -rf /app/maiko/linux* - -WORKDIR /app/maiko/bin -RUN ./makeright x - -RUN rm -rf /app/maiko/inc /app/maiko/include /app/maiko/src +LABEL release_tag=$RELEASE_TAG +ENV MAIKO_RELEASE=$RELEASE_TAG +ENV MAIKO_BUILD_DATE=$BUILD_DATE +ARG BUILD_LOCATION=/app/maiko +ARG INSTALL_LOCATION=/usr/local/interlisp/maiko +# +SHELL ["/bin/bash", "-c"] +USER root:root +# Copy release files into /usr/local/directories +COPY --from=builder ${BUILD_LOCATION}/bin/osversion ${INSTALL_LOCATION}/bin/ +COPY --from=builder ${BUILD_LOCATION}/bin/machinetype ${INSTALL_LOCATION}/bin/ +COPY --from=builder ${BUILD_LOCATION}/bin/config.guess ${INSTALL_LOCATION}/bin/ +COPY --from=builder ${BUILD_LOCATION}/bin/config.sub ${INSTALL_LOCATION}/bin/ +COPY --from=builder ${BUILD_LOCATION}/TRANSFER/lde* ${INSTALL_LOCATION}/TRANSFER/ +RUN cd ${INSTALL_LOCATION} && mv TRANSFER "$(cd bin && ./osversion).$(cd bin/ && ./machinetype)" +# Some niceties +USER root +WORKDIR /root +ENTRYPOINT /bin/bash