-
Notifications
You must be signed in to change notification settings - Fork 181
/
Dockerfile.bmo-slim
54 lines (43 loc) · 1.27 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
FROM perl:5.40.0-slim AS builder
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
apt-file \
build-essential \
cmake \
default-libmysqlclient-dev \
git \
libcairo-dev \
libexpat-dev \
libgd-dev \
libssl-dev \
openssl \
zlib1g-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 \
&& 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.40.0-slim
ENV DEBIAN_FRONTEND noninteractive
COPY --from=builder /app/local /app/local
COPY --from=builder /app/PACKAGES /app/PACKAGES
RUN cat /app/PACKAGES
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
git \
graphviz \
libcap2-bin \
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