forked from bugzilla/harmony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bmo-slim
71 lines (58 loc) · 2.76 KB
/
Dockerfile.bmo-slim
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
FROM perl:5.38.0-slim AS builder
RUN apt-get update
RUN apt-get -y dist-upgrade
RUN apt-get install -y \
apt-file \
build-essential \
cmake \
curl \
git \
libcairo-dev \
libexpat-dev \
libgd-dev \
libssl-dev \
openssl \
zlib1g-dev
# The Perl image is based on Debian, which doesn't have MySQL 8, and the
# current DBD::mysql requires MySQL 8 libraries to build, so we have
# to get the client libraries from mysql.com
RUN gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 5072E1F5 \
&& gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3A79BD29 \
&& gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C \
&& echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mysql-8.0.gpg] http://repo.mysql.com/apt/debian/ bookworm mysql-8.0' > /etc/apt/sources.list.d/mysql-8.0.list
RUN apt-get update \
&& apt-get install -y libmysqlclient-dev
RUN cpanm --notest --quiet App::cpm Module::CPANfile Carton::Snapshot
WORKDIR /app
COPY cpanfile cpanfile.snapshot /app/
RUN cpm install
# secure mail loop fixes
RUN cpm install http://s3.amazonaws.com/moz-devservices-bmocartons/third-party/Crypt-OpenPGP-1.15.tar.gz
RUN apt-file update
RUN find local -name '*.so' -exec ldd {} \; \
| egrep -v 'not.found|not.a.dynamic.executable' \
| awk '$3 {print $3}' \
| sort -u \
| xargs -IFILE apt-file search -l FILE \
| sort -u > PACKAGES
FROM perl:5.38.0-slim
ENV DEBIAN_FRONTEND noninteractive
COPY --from=builder /app/local /app/local
COPY --from=builder /app/PACKAGES /app/PACKAGES
RUN apt-get update \
&& apt-get install -y gnupg
RUN gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 5072E1F5 \
&& gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3A79BD29 \
&& gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mysql-8.0.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C \
&& echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mysql-8.0.gpg] http://repo.mysql.com/apt/debian/ bookworm mysql-8.0' > /etc/apt/sources.list.d/mysql-8.0.list
RUN apt-get update \
&& apt-get install -y \
curl \
git \
graphviz \
libcap2-bin \
libmysqlclient21 \
rsync \
$(cat /app/PACKAGES) \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*
RUN useradd -u 10001 -U app -m && setcap 'cap_net_bind_service=+ep' /usr/local/bin/perl