Skip to content

Commit

Permalink
add box64 builds for rpi 5, 4, and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol authored Dec 4, 2024
1 parent cdad232 commit ece70da
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 47 deletions.
118 changes: 93 additions & 25 deletions bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM arm64v8/python:slim-bookworm as box64_m1
FROM arm64v8/debian:bookworm-slim as box64_m1

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -7,23 +7,44 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
git \
box64-m1

############################################################

FROM arm64v8/debian:bookworm-slim as box64_rpi5_4k

ENV DEBIAN_FRONTEND noninteractive

# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
build-essential \
cmake \
mold \
&& git clone https://github.com/ptitSeb/box64.git \
&& mkdir /box64/build \
&& cd /box64/build \
&& cmake .. -D M1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -D WITH_MOLD=1 \
&& mold -run make -j$(nproc) \
&& make install DESTDIR=/tmp/install
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi5arm64

############################################################

FROM arm64v8/python:slim-bookworm as box64_rpi5
FROM aarm64v8/debian:bookworm-slim as box64_rpi5_16k

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -32,19 +53,63 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
git \
ca-certificates \
build-essential \
cmake \
mold \
&& git clone https://github.com/ptitSeb/box64.git \
&& mkdir /box64/build \
&& cd /box64/build \
&& cmake .. -D RPI5ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -D WITH_MOLD=1 \
&& mold -run make -j$(nproc) \
&& make install DESTDIR=/tmp/install
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi5arm64ps16k

############################################################

FROM arm64v8/debian:bookworm-slim as box64_rpi4

ENV DEBIAN_FRONTEND noninteractive

# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi4arm64

############################################################

FROM arm64v8/debian:bookworm-slim as box64_rpi3

ENV DEBIAN_FRONTEND noninteractive

# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi3arm64

############################################################

Expand Down Expand Up @@ -91,8 +156,11 @@ ENV DEBUGGER "/usr/local/bin/box86"
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

COPY --from=box64_m1 /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-m1
COPY --from=box64_rpi5 /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-rpi5
COPY --from=box64_m1 /usr/local/bin/box64 /usr/local/bin/box64-m1
COPY --from=box64_rpi5_4k /usr/local/bin/box64 /usr/local/bin/box64-rpi5
COPY --from=box64_rpi5_16k /usr/local/bin/box64 /usr/local/bin/box64-rpi5-16k
COPY --from=box64_rpi4 /usr/local/bin/box64 /usr/local/bin/box64-rpi4
COPY --from=box64_rpi3 /usr/local/bin/box64 /usr/local/bin/box64-rpi3
COPY --from=box64_adlink /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-adlink

# hadolint ignore=DL3008
Expand Down Expand Up @@ -129,7 +197,7 @@ RUN set -x \
&& apt-get download -y \
box86-generic-arm \
&& dpkg-deb -R *.deb box86_tmp \
&& rm box86_tmp/usr/lib/i386-linux-gnu/libstdc++.so.6 \
&& rm box86_tmp/usr/lib/i386-linux-gnu/libstdc++.so* \
&& dpkg-deb -b box86_tmp new_box86.deb \
&& dpkg -i new_box86.deb \
&& rm -rf *.deb \
Expand Down
9 changes: 9 additions & 0 deletions box64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ case $ARM64_DEVICE in
rpi5)
BINARY_PATH="/usr/local/bin/box64-rpi5"
;;
rpi5_16k)
BINARY_PATH="/usr/local/bin/box64-rpi5-16k"
;;
rpi4)
BINARY_PATH="/usr/local/bin/box64-rpi4"
;;
rpi3)
BINARY_PATH="/usr/local/bin/box64-rpi3"
;;
m1)
BINARY_PATH="/usr/local/bin/box64-m1"
;;
Expand Down
114 changes: 92 additions & 22 deletions bullseye/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM arm64v8/python:slim-bullseye as box64_m1
FROM aarm64v8/debian:bullseye-slim as box64_m1

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -7,22 +7,44 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
git \
box64-m1

############################################################

FROM arm64v8/debian:bullseye-slim as box64_rpi5_4k

ENV DEBIAN_FRONTEND noninteractive

# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
build-essential \
cmake \
&& git clone https://github.com/ptitSeb/box64.git \
&& mkdir /box64/build \
&& cd /box64/build \
&& cmake .. -D M1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo \
&& make -j$(nproc) \
&& make install DESTDIR=/tmp/install
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi5arm64

############################################################

FROM arm64v8/python:slim-bullseye as box64_rpi5
FROM arm64v8/debian:bullseye-slim as box64_rpi5_16k

ENV DEBIAN_FRONTEND noninteractive

Expand All @@ -31,18 +53,63 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
git \
ca-certificates \
build-essential \
cmake \
&& git clone https://github.com/ptitSeb/box64.git \
&& mkdir /box64/build \
&& cd /box64/build \
&& cmake .. -D RPI5ARM64=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo \
&& make -j$(nproc) \
&& make install DESTDIR=/tmp/install
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi5arm64ps16k

############################################################

FROM arm64v8/debian:bullseye-slim as box64_rpi4

ENV DEBIAN_FRONTEND noninteractive

# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi4arm64

############################################################

FROM arm64v8/debian:bullseye-slim as box64_rpi3

ENV DEBIAN_FRONTEND noninteractive

# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN set -x \
# Install, update & upgrade packages
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
wget \
gnupg \
&& wget --progress=dot:giga https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list \
&& (wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg) \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
box64-rpi3arm64

############################################################

Expand Down Expand Up @@ -88,8 +155,11 @@ ENV DEBUGGER "/usr/local/bin/box86"
# Set SHELL option explicitly
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

COPY --from=box64_m1 /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-m1
COPY --from=box64_rpi5 /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-rpi5
COPY --from=box64_m1 /usr/local/bin/box64 /usr/local/bin/box64-m1
COPY --from=box64_rpi5_4k /usr/local/bin/box64 /usr/local/bin/box64-rpi5
COPY --from=box64_rpi5_16k /usr/local/bin/box64 /usr/local/bin/box64-rpi5-16k
COPY --from=box64_rpi4 /usr/local/bin/box64 /usr/local/bin/box64-rpi4
COPY --from=box64_rpi3 /usr/local/bin/box64 /usr/local/bin/box64-rpi3
COPY --from=box64_adlink /tmp/install/usr/local/bin/box64 /usr/local/bin/box64-adlink

# hadolint ignore=DL3008
Expand Down

0 comments on commit ece70da

Please sign in to comment.