-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (39 loc) · 1.59 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
# BASE
ARG OS_DISTRO=ubuntu
ARG OS_RELEASE=latest
FROM ${OS_DISTRO}:${OS_RELEASE} AS base
LABEL maintainer="Adam Schobelock <[email protected]>"
#MAINTAINER Adam Schobelock <[email protected]>
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y apt-utils curl dialog gnupg perl \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoclean
COPY ./docker-entrypoint.sh /opt
ENTRYPOINT ["/opt/docker-entrypoint.sh"]
# BUIDLER
FROM base AS builder
ARG PERLBREW_REQUIRED_MODULES="build-essential"
ARG BUILDER_OPTIONAL_MODULES="vim less plocate unminimize"
ARG PERL_VERSION=stable
ARG HARNESS_OPTIONS=j6
ENV HARNESS_OPTIONS=${HARNESS_OPTIONS}
ENV PERLBREW_ROOT=/opt/perlbrew
ENV PERLBREW_HOME=/opt/perlbrew/perl5
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y ${PERLBREW_REQUIRED_MODULES} ${BUILDER_OPTIONAL_MODULES} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoclean
RUN yes | /usr/bin/unminimize
RUN curl -L https://install.perlbrew.pl | /bin/bash
RUN /opt/docker-entrypoint.sh perlbrew init
RUN yes | /opt/docker-entrypoint.sh perlbrew install-patchperl
RUN /opt/docker-entrypoint.sh perlbrew install-cpanm
RUN /opt/docker-entrypoint.sh perlbrew install -${HARNESS_OPTIONS} ${PERL_VERSION}
RUN /opt/docker-entrypoint.sh perlbrew clean
RUN /opt/docker-entrypoint.sh perlbrew list |grep perl- |sed 's/ //g' >/opt/perlbrew/version.txt
ENTRYPOINT ["/opt/docker-entrypoint.sh"]
# FINAL
FROM base AS perlbrew
COPY --from=builder /opt/perlbrew /opt/perlbrew
ENTRYPOINT ["/opt/docker-entrypoint.sh"]