diff --git a/docker/edk2/Dockerfile b/docker/edk2/Dockerfile index 0b57f176..aa99953b 100644 --- a/docker/edk2/Dockerfile +++ b/docker/edk2/Dockerfile @@ -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} \ @@ -44,7 +47,6 @@ RUN dpkg --add-architecture i386 && \ flex \ g++-${GCC_VERSION} \ gcc-${GCC_VERSION} \ - ${GCC_CROSS_COMPILER_PACKAGES} \ git \ imagemagick \ iucode-tool \ @@ -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 \ @@ -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 @@ -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/*