Skip to content

Commit

Permalink
Move to multi-stage docker build
Browse files Browse the repository at this point in the history
Also add additional packages to the build container for hosts that don't know anything about python, like Docker Desktop on OSX/Windows.
  • Loading branch information
DigitallyBorn committed Jan 31, 2019
1 parent 6b31cd8 commit d4dbc94
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
FROM python:3.7-alpine as build
RUN apk add --no-cache linux-headers g++ gcc libxml2-dev libxml2 libxslt-dev
COPY requirements.txt /opt/sherlock/
WORKDIR /wheels
RUN pip3 wheel -r /opt/sherlock/requirements.txt

FROM python:3.7-alpine
RUN /sbin/apk add tor
COPY --from=build /wheels /wheels
COPY . /opt/sherlock/
RUN /usr/local/bin/pip install -r /opt/sherlock/requirements.txt
WORKDIR /opt/sherlock
RUN pip3 install -r requirements.txt -f /wheels \
&& rm -rf /wheels \
&& rm -rf /root/.cache/pip/*

ENTRYPOINT ["python", "/opt/sherlock/sherlock.py"]
ENTRYPOINT ["python", "sherlock.py"]

0 comments on commit d4dbc94

Please sign in to comment.