Skip to content

Commit 7c62ee1

Browse files
committed
resources: Add aarch64 support to Dockerfile
Signed-off-by: Akira Moroo <[email protected]>
1 parent 37c2fb9 commit 7c62ee1

File tree

1 file changed

+43
-16
lines changed

1 file changed

+43
-16
lines changed

resources/Dockerfile

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ENV PATH="$PATH:$CARGO_HOME/bin"
1414
ENV COREBOOT_DIR=/opt/coreboot/src
1515

1616
# Install all CI dependencies
17-
RUN apt-get update \
17+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
18+
apt-get update \
1819
&& apt-get -yq upgrade \
1920
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
2021
build-essential \
@@ -49,7 +50,29 @@ RUN apt-get update \
4950
zlib1g-dev \
5051
gnat-9 \
5152
&& apt-get clean \
52-
&& rm -rf /var/lib/apt/lists/*
53+
&& rm -rf /var/lib/apt/lists/* \
54+
; fi
55+
56+
RUN if [ "$TARGETARCH" = "arm64" ]; then \
57+
apt-get update \
58+
&& apt-get -yq upgrade \
59+
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
60+
build-essential \
61+
docker.io \
62+
curl \
63+
wget \
64+
sudo \
65+
mtools \
66+
libssl-dev \
67+
pkg-config \
68+
qemu-utils \
69+
libseccomp-dev \
70+
libcap-ng-dev \
71+
libcap2-bin \
72+
dosfstools \
73+
&& apt-get clean \
74+
&& rm -rf /var/lib/apt/lists/* \
75+
; fi
5376

5477
# Fix the libssl-dev install
5578
RUN export ARCH="$(uname -m)" \
@@ -62,22 +85,26 @@ ENV OPENSSL_INCLUDE_DIR=/usr/include/
6285

6386
# Install the rust toolchain
6487
RUN export ARCH="$(uname -m)" \
65-
&& nohup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
66-
&& rustup component add rustfmt \
67-
&& rustup component add clippy \
68-
&& rustup component add rust-src \
69-
&& rm -rf "$CARGO_HOME/registry" \
70-
&& ln -s "$CARGO_REGISTRY_DIR" "$CARGO_HOME/registry" \
71-
&& rm -rf "$CARGO_HOME/git" \
72-
&& ln -s "$CARGO_GIT_REGISTRY_DIR" "$CARGO_HOME/git"
88+
&& nohup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
89+
&& rustup component add rustfmt \
90+
&& rustup component add clippy \
91+
&& rustup component add rust-src \
92+
&& rustup target add aarch64-unknown-linux-gnu \
93+
&& rustup target add x86_64-unknown-linux-gnu \
94+
&& rm -rf "$CARGO_HOME/registry" \
95+
&& ln -s "$CARGO_REGISTRY_DIR" "$CARGO_HOME/registry" \
96+
&& rm -rf "$CARGO_HOME/git" \
97+
&& ln -s "$CARGO_GIT_REGISTRY_DIR" "$CARGO_HOME/git"
7398

7499
# Set the rust environment
75100
RUN echo 'source $CARGO_HOME/env' >> $HOME/.bashrc \
76-
&& mkdir $HOME/.cargo \
77-
&& ln -s $CARGO_HOME/env $HOME/.cargo/env
101+
&& mkdir $HOME/.cargo \
102+
&& ln -s $CARGO_HOME/env $HOME/.cargo/env
78103

79104
# Checkout coreboot repository and setup cross toolchains
80-
RUN git clone --quiet --branch "$COREBOOT_VERSION" --depth 1 https://github.com/coreboot/coreboot.git "$COREBOOT_DIR" \
81-
&& cd "$COREBOOT_DIR" \
82-
&& git submodule update --init --checkout \
83-
&& make crossgcc-i386 CPUS=`nproc`
105+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
106+
git clone --quiet --branch "$COREBOOT_VERSION" --depth 1 https://github.com/coreboot/coreboot.git "$COREBOOT_DIR" \
107+
&& cd "$COREBOOT_DIR" \
108+
&& git submodule update --init --checkout \
109+
&& make crossgcc-i386 CPUS=`nproc`; \
110+
fi

0 commit comments

Comments
 (0)