-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
104 lines (88 loc) · 2.42 KB
/
Dockerfile
File metadata and controls
104 lines (88 loc) · 2.42 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
# i know this is crazy, but installing our own perl is just better in the long run.
ARG BASE_ARCH
FROM $BASE_ARCH
MAINTAINER Drew
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
RUN apk update && apk upgrade
# install packages
RUN \
apk add --no-cache \
curl \
jq \
openssl \
openssl-dev \
wget \
tar \
make \
gcc \
build-base \
gnupg \
redis \
zlib-dev \
zlib \
docker-cli \
py-pip \
python3-dev \
wiringpi
# build perl
RUN mkdir -p /usr/src/perl
WORKDIR /usr/src/perl
## from perl; `true make test_harness` because 3 tests fail
## some flags from http://git.alpinelinux.org/cgit/aports/tree/main/perl/APKBUILD?id=19b23f225d6e4f25330e13144c7bf6c01e624656
RUN curl -SLO https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.26.2.tar.bz2 \
&& echo '2057b65e3a6ac71287c973402cd01084a1edc35b *perl-5.26.2.tar.bz2' | sha1sum -c - \
&& tar --strip-components=1 -xjf perl-5.26.2.tar.bz2 -C /usr/src/perl \
&& rm perl-5.26.2.tar.bz2 \
&& ./Configure -des \
-Dcccdlflags='-fPIC' \
-Dcccdlflags='-fPIC' \
-Dccdlflags='-rdynamic' \
-Dlocincpth=' ' \
-Duselargefiles \
-Dusethreads \
-Duseshrplib \
-Dd_semctl_semun \
-Dusenm \
&& make libperl.so \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) true make test_harness \
&& make install \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
## from tianon/perl
ENV PERL_CPANM_OPT --verbose --mirror https://cpan.metacpan.org --mirror-only
RUN cpanm Digest::SHA Module::Signature && rm -rf ~/.cpanm
WORKDIR /
RUN echo "***** installing prereq ****" && cpanm -f -v --notest Time::Zone Date::Parse CHI DateTime
ENV PERL_CPANM_OPT $PERL_CPANM_OPT --verify
RUN \
echo "***** install perl modules ****" && \
cpanm --no-wget --notest \
AnyEvent \
AnyEvent::Fork \
FindBin Data::Dumper \
Log::Log4perl \
JSON \
Config::Simple \
Redis \
Storable \
String::Escape \
IO::Socket \
HTTP::Tiny \
Coro \
EV \
InfluxDB::LineProtocol \
AnyEvent::DateTime::Cron \
AnyEvent::HTTPD \
Net::MQTT::Simple
# copy local files
RUN mkdir /poolBot
COPY . /poolBot/
RUN chmod +x /poolBot/bin/poolBot.pl
EXPOSE 8080
ENTRYPOINT ["perl", "/poolBot/bin/poolBot.pl"]