-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
91 lines (68 loc) · 2.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Use Debian Bullseye as a base image to link against glibc 2.31.
FROM public.ecr.aws/debian/debian:bullseye-slim AS base
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bash \
curl \
git \
ca-certificates \
build-essential \
pkg-config \
libssl-dev \
libstdc++-10-dev
WORKDIR /root
# ==============================================================================
FROM base AS deps-src
COPY versions.sh download-deps.sh ./
RUN ./download-deps.sh
# ==============================================================================
FROM base AS deps
COPY install-rust.sh ./
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
autoconf \
autopoint \
automake \
cmake \
nasm \
libtool \
python3-pip \
python3-venv \
gettext \
gperf \
&& ./install-rust.sh \
&& python3 -m venv /root/.python \
&& /root/.python/bin/pip install meson ninja packaging
COPY versions.sh build-deps.sh build-bash-profile.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
ENV BASH_ENV=/root/.bashrc
RUN ./build-deps.sh
# ==============================================================================
FROM base AS golang
COPY versions.sh install-go.sh ./
RUN ./install-go.sh
# ==============================================================================
FROM public.ecr.aws/debian/debian:bullseye-slim AS final
LABEL maintainer="Sergey Alexandrovich <[email protected]>"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bash \
curl \
git \
ca-certificates \
build-essential \
pkg-config \
libssl-dev \
libstdc++-10-dev
WORKDIR /root
COPY --from=golang /usr/local/go /usr/local/go
ENV PATH=$PATH:/usr/local/go/bin
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 /root/.bashrc /root/.bashrc
ENV BASH_ENV=/root/.bashrc
WORKDIR /app
CMD ["bash"]