Skip to content

Commit

Permalink
fix(docker): make edk2 container multi-arch
Browse files Browse the repository at this point in the history
Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Sep 30, 2024
1 parent 4fa7fd8 commit 992d9d5
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions docker/edk2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ ENV TOOLSDIR=/tools
ENV WORKSPACE_CORE=$TOOLSDIR/Edk2
ENV WORKSPACE=$TOOLSDIR/Edk2

RUN dpkg --add-architecture i386 && \
RUN arch="$(dpkg --print-architecture)" && arch="${arch##*-}"; \
if [ "${arch}" = 'amd64' ]; then \
dpkg --add-architecture i386; \
fi; \
apt-get update && \
apt-get install -y --no-install-recommends \
${PYTHON_PACKAGES} \
Expand All @@ -44,7 +47,6 @@ RUN dpkg --add-architecture i386 && \
flex \
g++-${GCC_VERSION} \
gcc-${GCC_VERSION} \
${GCC_CROSS_COMPILER_PACKAGES} \
git \
imagemagick \
iucode-tool \
Expand All @@ -57,6 +59,10 @@ RUN dpkg --add-architecture i386 && \
wine32 \
wine64 \
&& \
if [ "${arch}" = 'amd64' ]; then \
apt-get install -y --no-install-recommends \
${GCC_CROSS_COMPILER_PACKAGES}; \
fi; \
apt-get install -y --no-install-recommends \
less \
nano \
Expand All @@ -69,9 +75,10 @@ RUN dpkg --add-architecture i386 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p "${TOOLSDIR}" && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 100 && \
\
if [ "${arch}" = 'amd64' ]; then \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 100; \
fi; \
wget --quiet -O rustup.sh https://sh.rustup.rs && \
chmod +x ./rustup.sh && \
./rustup.sh -y --profile minimal
Expand All @@ -86,8 +93,12 @@ RUN apt-get update && \
clang \
llvm \
lld \
gcc-multilib \
&& \
arch="$(dpkg --print-architecture)" && arch="${arch##*-}"; \
if [ "${arch}" = 'amd64' ]; then \
apt-get install -y --no-install-recommends \
gcc-multilib; \
fi; \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down

0 comments on commit 992d9d5

Please sign in to comment.