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
|
# 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
|
FROM ubuntu:24.04 AS build
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
@@ -46,51 +49,6 @@ RUN cd taptools/taptools* \
|
|||||||
&& make -j8 \
|
&& make -j8 \
|
||||||
&& make install
|
&& 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
|
FROM ubuntu:24.04
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& 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/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 /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=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 PATH="${PATH}:/opt/z88dk/bin:/opt/zxbasic:/opt/zxbasic/tools:/opt/pasta80"
|
||||||
ENV ZCCCFG="/opt/z88dk/lib/config"
|
ENV ZCCCFG="/opt/z88dk/lib/config"
|
||||||
USER ubuntu
|
USER ubuntu
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "ZX Spectrum dev tools",
|
"name": "ZX Spectrum dev tools",
|
||||||
//"build": { "dockerfile": "Dockerfile" },
|
//"build": { "dockerfile": "Dockerfile" },
|
||||||
// The Dockerfile takes an age to build due to z88dk, so pull from prebuilt:
|
// The Dockerfile takes an age to build due to z88dk, so pull from prebuilt:
|
||||||
"image": "boarstone.mcphail.uk/mcphail/speccydev:v7.0",
|
"image": "boarstone.mcphail.uk/mcphail/speccydev:combined",
|
||||||
"remoteUser": "ubuntu",
|
"remoteUser": "ubuntu",
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"--network=host"
|
"--network=host"
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
# Similar to the speccydev container, I'm building this with:
|
||||||
|
# docker buildx build --platform linux/arm64/v8,linux/amd64 -t boarstone.mcphail.uk/mcphail/z88dk:tagname .
|
||||||
|
|
||||||
|
FROM ubuntu:24.04 AS build
|
||||||
|
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
|
||||||
|
COPY --from=build /opt/z88dk/ /opt/z88dk/
|
||||||
|
ENV PATH="$(PATH):/opt/z88dk/bin"
|
||||||
|
ENV ZCCCFG="/opt/z88dk/lib/config"
|
||||||
|
USER ubuntu
|
||||||
Reference in New Issue
Block a user