Try combined amd64/arm64 build
Split Dockerfile so z88dk doesn't have to be rebuilt every time it falls out od cache
This commit is contained in:
+10
-46
@@ -1,5 +1,8 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# My current workflow is to build this on an M1 MacBook for both amd64 and arm64 using:
|
||||
# docker buildx build --platform linux/arm64/v8,linux/amd64 -t boarstone.mcphail.uk/mcphail/speccydev:tagname .
|
||||
|
||||
FROM ubuntu:24.04 AS build
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
@@ -46,51 +49,6 @@ RUN cd taptools/taptools* \
|
||||
&& make -j8 \
|
||||
&& make install
|
||||
|
||||
FROM ubuntu:24.04 AS z88dk
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
bison \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
ccache \
|
||||
cpanminus \
|
||||
curl \
|
||||
dos2unix \
|
||||
flex \
|
||||
gdb \
|
||||
git \
|
||||
libboost-all-dev \
|
||||
libcapture-tiny-perl \
|
||||
libclone-perl \
|
||||
libdata-hexdump-perl \
|
||||
libfile-slurp-perl \
|
||||
libgmp3-dev \
|
||||
liblocal-lib-perl \
|
||||
libmodern-perl-perl \
|
||||
libpath-tiny-perl \
|
||||
libregexp-common-perl \
|
||||
libtext-table-perl \
|
||||
libxml2-dev \
|
||||
libyaml-perl \
|
||||
m4 \
|
||||
make \
|
||||
perl \
|
||||
pkg-config \
|
||||
ragel \
|
||||
re2c \
|
||||
texi2html \
|
||||
texinfo \
|
||||
zlib1g-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ENV Z88DK_PATH="/opt/z88dk"
|
||||
RUN cpanm -l $HOME/perl5 --no-wget local::lib Template::Plugin::YAML \
|
||||
&& git clone --depth 1 --branch v2.4 --recursive https://github.com/z88dk/z88dk.git ${Z88DK_PATH} \
|
||||
&& cd ${Z88DK_PATH} \
|
||||
&& eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" \
|
||||
&& chmod 777 build.sh \
|
||||
&& BUILD_SDCC=1 BUILD_SDCC_HTTP=1 ./build.sh \
|
||||
&& make install-clean bins-clean
|
||||
|
||||
FROM ubuntu:24.04
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
@@ -120,7 +78,13 @@ COPY --from=build /inpaws/inpaws /bin/inpaws
|
||||
COPY --from=build /usr/local/bin/ /usr/local/bin/
|
||||
COPY --from=build /usr/local/lib/python3.12/dist-packages/skoolkit/ /usr/local/lib/python3.12/dist-packages/skoolkit/
|
||||
COPY --from=build /opt/pasta80 /opt/pasta80
|
||||
COPY --from=z88dk /opt/z88dk/ /opt/z88dk/
|
||||
|
||||
# z88dk takes a long time to cross compile so I'm keeping this in a separate container
|
||||
# so it doesn't require building every time the cache expires. The Dockerfile for z88dk
|
||||
# is in a subdirectory of this one. If you're building the container yourself you may
|
||||
# want to alter the next line to your own tagged build of z88dk but you're welcome to
|
||||
# use mine.
|
||||
COPY --from=boarstone.mcphail.uk/mcphail/z88dk:v2.4 /opt/z88dk/ /opt/z88dk/
|
||||
ENV PATH="${PATH}:/opt/z88dk/bin:/opt/zxbasic:/opt/zxbasic/tools:/opt/pasta80"
|
||||
ENV ZCCCFG="/opt/z88dk/lib/config"
|
||||
USER ubuntu
|
||||
|
||||
Reference in New Issue
Block a user