mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-03 13:04:35 +08:00
Fix: Do not install rust on mips64el
This commit is contained in:
parent
676da62a7f
commit
437fb8bdb5
2 changed files with 12 additions and 6 deletions
|
@ -41,7 +41,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=var-cache-
|
|||
--mount=type=tmpfs,target=/tmp \
|
||||
--mount=type=tmpfs,target=/sasl-xoauth2 \
|
||||
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
|
||||
sh /build-scripts/sasl-build.sh
|
||||
bash /build-scripts/sasl-build.sh
|
||||
|
||||
# ============================ Prepare main image ============================
|
||||
FROM sasl
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
local arch="$(uname -m)"
|
||||
|
||||
# Build the sasl2 library with the sasl-xoauth2 plugin.
|
||||
#
|
||||
# The sasl-xoauth2 plugin is a SASL plugin that provides support for XOAUTH2 (OAuth 2.0) authentication.
|
||||
|
@ -46,9 +48,11 @@ build_sasl2() {
|
|||
# (because they don't exist in the PIP repositories) and "pip install" will fail without rust. Specifically, when
|
||||
# compiling cryptographic libraries.
|
||||
setup_rust() {
|
||||
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
. "$HOME/.cargo/env"
|
||||
if [[ "${arch}"!= "386" ]] && [[ "${arch}"!= "i386" ]] && [[ "${arch}"!= "mips64el" ]]; then
|
||||
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
. "$HOME/.cargo/env"
|
||||
fi
|
||||
}
|
||||
|
||||
# Create a virtual environment and install the msal library for the
|
||||
|
@ -56,7 +60,7 @@ setup_rust() {
|
|||
setup_python_venv() {
|
||||
python3 -m venv /sasl
|
||||
. /sasl/bin/activate
|
||||
if [[ "$(uname -m)"!= "386" ]] && [[ "$(uname -m)"!= "i386" ]]; then
|
||||
if [[ "${arch}"!= "386" ]] && [[ "${arch}"!= "i386" ]] && [[ "${arch}"!= "mips64el" ]]; then
|
||||
pip3 install msal
|
||||
fi
|
||||
}
|
||||
|
@ -96,7 +100,9 @@ else
|
|||
# Run compilation and installation
|
||||
setup_rust
|
||||
base_install
|
||||
rustup self uninstall -y
|
||||
if [[ "${arch}"!= "386" ]] && [[ "${arch}"!= "i386" ]] && [[ "${arch}"!= "mips64el" ]]; then
|
||||
rustup self uninstall -y
|
||||
fi
|
||||
|
||||
# Cleanup. This is important to ensure that we don't keep unnecessary files laying around and thus increasing the size of the image.
|
||||
apt-get remove --purge -y ${LIBS} python3-venv
|
||||
|
|
Loading…
Add table
Reference in a new issue