Skip to content

Commit

Permalink
Adding Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-k0 committed Dec 11, 2018
1 parent 37da944 commit ec7cba2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM alpine as build

RUN apk add --no-cache python3 python3-dev build-base libffi-dev openssl-dev linux-headers git && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools wheel && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
rm -r /root/.cache

COPY . /sonny
WORKDIR /sonny

RUN pip install -e . && python setup.py bdist_wheel



FROM alpine

COPY --from=build /sonny/dist/*.whl .
RUN apk add --no-cache python3 python3-dev build-base libffi-dev openssl-dev linux-headers git nmap && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools wheel && \
pip3 install --upgrade *.whl && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
rm -r /root/.cache && rm *.whl

WORKDIR /root
CMD ["true"]

0 comments on commit ec7cba2

Please sign in to comment.