11# Use Debian Bullseye as a base image to link against glibc 2.31
2- FROM --platform=${BUILDPLATFORM} debian:bullseye-slim AS base
2+ FROM debian:bullseye-slim AS base
33
4- ARG TARGETARCH
5-
6- RUN dpkg --add-architecture ${TARGETARCH} \
7- && apt-get update \
4+ RUN apt-get update \
85 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
96 bash \
107 curl \
118 git \
129 ca-certificates \
13- crossbuild -essential-${TARGETARCH} \
10+ build -essential \
1411 pkg-config \
1512 libssl-dev \
16- libstdc++-10-dev:${TARGETARCH}
13+ libstdc++-10-dev
1714
1815WORKDIR /root
1916
2017# ==============================================================================
2118
22- FROM --platform=${BUILDPLATFORM} base AS deps-src
19+ FROM base AS deps-src
2320
2421COPY versions.sh download-deps.sh ./
2522RUN ./download-deps.sh
2623
2724# ==============================================================================
2825
29- FROM --platform=${BUILDPLATFORM} base AS deps
30-
31- ARG TARGETARCH
26+ FROM base AS deps
3227
3328COPY install-rust.sh ./
3429
@@ -47,10 +42,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4742 && python3 -m venv /root/.python \
4843 && /root/.python/bin/pip install meson ninja packaging
4944
50- COPY versions.sh build-deps.sh build-bash-profile.sh *.patch cmake_${TARGETARCH}.cmake meson_${TARGETARCH}.ini ./
45+ COPY versions.sh build-deps.sh build-bash-profile.sh *.patch ./
5146COPY --from=deps-src /root/deps /root/deps
5247
53- # We need environment variables that based on the TARGETARCH ,
48+ # We need environment variables that are based on the uname -m output ,
5449# so we have to use a Bash profile instead of ENV
5550RUN ./build-bash-profile.sh > /root/.bashrc
5651ENV BASH_ENV=/root/.bashrc
@@ -59,21 +54,17 @@ RUN ./build-deps.sh
5954
6055# ==============================================================================
6156
62- FROM --platform=${BUILDPLATFORM} base as golang
57+ FROM base AS golang
6358
6459COPY versions.sh install-go.sh ./
6560RUN ./install-go.sh
6661
6762# ==============================================================================
6863
69- FROM --platform=${TARGETPLATFORM} debian:bullseye-slim AS final
64+ FROM debian:bullseye-slim AS final
7065LABEL maintainer="Sergey Alexandrovich <darthsim@gmail.com>"
7166
72- ARG TARGETARCH
73- ARG BUILDARCH
74-
75- RUN dpkg --add-architecture ${BUILDARCH} \
76- && apt-get update \
67+ RUN apt-get update \
7768 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7869 bash \
7970 curl \
@@ -87,7 +78,7 @@ RUN dpkg --add-architecture ${BUILDARCH} \
8778WORKDIR /root
8879
8980COPY --from=golang /usr/local/go /usr/local/go
90- ENV PATH $PATH:/usr/local/go/bin
81+ ENV PATH= $PATH:/usr/local/go/bin
9182
9283COPY --from=deps /opt/imgproxy/lib /opt/imgproxy/lib
9384COPY --from=deps /opt/imgproxy/include /opt/imgproxy/include
@@ -97,4 +88,4 @@ COPY --from=deps /root/.bashrc /root/.bashrc
9788ENV BASH_ENV=/root/.bashrc
9889
9990WORKDIR /app
100- CMD bash
91+ CMD [ " bash" ]
0 commit comments