Skip to content

Commit b033e17

Browse files
authored
Merge pull request #56 from pisces-period/master
move pip requirements to a file, upgrade ubuntu
2 parents e32ecde + ee58fcf commit b033e17

File tree

2 files changed

+53
-34
lines changed

2 files changed

+53
-34
lines changed

canarytokens/Dockerfile

+29-34
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:18.04 as builder
2+
23
MAINTAINER Marco Slaviero <[email protected]>
4+
35
LABEL Description="This image provides the frontend site for Canarytokens" Vendor="Thinkst Applied Research" Version="1.4"
4-
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget python-pip unzip osslsigncode gcc python-dev libreadline-dev libncurses5-dev libffi-dev gcc patch make libxslt-dev libxml2-dev libz-dev fortune-mod fortunes libssl-dev && rm -rf /var/lib/apt/lists/*
6+
# setting the current directory
57
WORKDIR /
6-
RUN pip install -U setuptools
7-
RUN pip install --upgrade pip
8-
RUN pip install --no-cache-dir pyOpenSSL==16.2.0
9-
RUN pip install --no-cache-dir Jinja2==2.9.4
10-
RUN pip install --no-cache-dir MarkupSafe==0.23
11-
RUN pip install --no-cache-dir Twisted==15.2.1
12-
RUN pip install --no-cache-dir cssselect==0.9.1
13-
RUN pip install --no-cache-dir docopt==0.4.0
14-
RUN pip install --no-cache-dir gnureadline==6.3.3
15-
RUN pip install --no-cache-dir httplib2==0.9.1
16-
RUN pip install --no-cache-dir lxml==3.4.4
17-
RUN pip install --no-cache-dir mandrill==1.0.57
18-
RUN pip install --no-cache-dir pytz==2015.4
19-
RUN pip install --no-cache-dir redis==2.10.3
20-
RUN pip install --no-cache-dir requests==2.20.0
21-
RUN pip install --no-cache-dir simplejson==3.7.3
22-
RUN pip install --no-cache-dir six==1.10.0
23-
RUN pip install --no-cache-dir twilio==4.4.0
24-
RUN pip install --no-cache-dir twill==1.8.0
25-
RUN pip install --no-cache-dir wsgiref==0.1.2
26-
RUN pip install --no-cache-dir zope.interface==4.1.2
27-
RUN pip install --no-cache-dir PyQRCode==1.2.1
28-
RUN pip install --no-cache-dir pypng==0.0.18
29-
RUN pip install --no-cache-dir htmlmin==0.1.10
30-
RUN pip install --no-cache-dir sendgrid==3.6.5
31-
RUN pip install --no-cache-dir service_identity
32-
33-
RUN wget -O master.zip https://github.com/thinkst/canarytokens/archive/master.zip?step=22
34-
RUN unzip master.zip
35-
RUN mv /canarytokens-master/* /srv
36-
RUN rm -rf /canarytokens-master
8+
# uploading PIP requirements file into the base image
9+
COPY requirements.txt ./
10+
# removing PIP deprecation banners
11+
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
12+
# concatenating RUN commands into a single image layer
13+
# installing PIP requirements from requirements.txt file
14+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
15+
wget python-pip unzip osslsigncode gcc python-dev libreadline-dev \
16+
libncurses5-dev libffi-dev gcc patch make libxslt-dev libxml2-dev \
17+
libz-dev fortune-mod fortunes libssl-dev && \
18+
rm -rf /var/lib/apt/lists/* && \
19+
pip install -U setuptools && \
20+
pip install --upgrade pip && \
21+
pip install --no-cache-dir -r requirements.txt && \
22+
wget -O master.zip https://github.com/thinkst/canarytokens/archive/master.zip?step=22 && \
23+
unzip master.zip && \
24+
mv /canarytokens-master/* /srv && \
25+
rm -rf /canarytokens-master
26+
# discarding the build-stage image and adding a new one
27+
# with only the necessary binaries/libraries to run the app
28+
FROM builder as canary-tokens
29+
# copy the working directory from the previous image into the final image
30+
COPY --from=builder /srv /srv
31+
# seting the working environment
3732
WORKDIR /srv
3833

39-
CMD echo "Please use the docker-compose setup described at https://github.com/thinkst/canarytokens-docker"
34+
CMD echo "Please use the docker-compose setup described at https://github.com/thinkst/canarytokens-docker"

canarytokens/requirements.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pyOpenSSL==16.2.0
2+
Jinja2==2.9.4
3+
MarkupSafe==0.23
4+
Twisted==15.2.1
5+
cssselect==0.9.1
6+
docopt==0.4.0
7+
gnureadline==6.3.3
8+
httplib2==0.9.1
9+
lxml==3.4.4
10+
mandrill==1.0.57
11+
pytz==2015.4
12+
redis==2.10.3
13+
requests==2.20.0
14+
simplejson==3.7.3
15+
six==1.10.0
16+
twilio==4.4.0
17+
twill==1.8.0
18+
wsgiref==0.1.2
19+
zope.interface==4.1.2
20+
PyQRCode==1.2.1
21+
pypng==0.0.18
22+
htmlmin==0.1.10
23+
sendgrid==3.6.5
24+
service_identity

0 commit comments

Comments
 (0)