Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ RUN apt-get update \
&& python3 -m venv /root/.python \
&& /root/.python/bin/pip install meson ninja packaging cmake

COPY versions.sh build-deps.sh build-bash-profile.sh *.patch ./
COPY versions.sh build-deps.sh *.patch ./
COPY --from=deps-src /root/deps /root/deps

# We need environment variables that are based on the uname -m output,
# so we have to use a Bash profile instead of ENV
RUN ./build-bash-profile.sh > /root/.bashrc
COPY bashrc.sh /root/.bashrc
ENV BASH_ENV=/root/.bashrc

RUN ./build-deps.sh
Expand Down Expand Up @@ -131,6 +131,7 @@ COPY --from=deps /root/deps/lychee/lychee /usr/local/bin/lychee
COPY --from=deps /opt/imgproxy/lib /opt/imgproxy/lib
COPY --from=deps /opt/imgproxy/include /opt/imgproxy/include
COPY --from=deps /opt/imgproxy/bin /opt/imgproxy/bin
COPY --from=deps /opt/imgproxy/sbom /opt/imgproxy/sbom

COPY --from=deps /root/.bashrc /root/.bashrc
ENV BASH_ENV=/root/.bashrc
Expand Down
24 changes: 24 additions & 0 deletions bashrc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -e

case "$(uname -m)" in
x86_64)
export CFLAGS="-msse4"
)
;;

aarch64)
export CFLAGS="-march=armv8.2-a+fp16"
;;
esac

export PATH="/opt/imgproxy/bin:/root/.cargo/bin:/root/.python/bin:$PATH"
export PKG_CONFIG_LIBDIR=/opt/imgproxy/lib/pkgconfig
export CGO_LDFLAGS_ALLOW="-s|-w"
export CGO_LDFLAGS="-Wl,-rpath,/opt/imgproxy/lib"

export CFLAGS="$CFLAGS -Os -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections"
export CXXFLAGS=$CFLAGS
export CPPFLAGS="$CPPFLAGS -I/opt/imgproxy/include"
export LDFLAGS="$LDFLAGS -L/opt/imgproxy/lib -Wl,--gc-sections -Wl,-rpath,/opt/imgproxy/lib"
37 changes: 0 additions & 37 deletions build-bash-profile.sh

This file was deleted.

Loading