-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile: python3.9 and stop using pex (#32)
- Loading branch information
1 parent
7fa1d15
commit f234e89
Showing
1 changed file
with
13 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
# | ||
# HOWTO | ||
# | ||
# Generate the PEX first using tox -e bundle | ||
# the result has to be in dist/ | ||
# | ||
# Build the image: docker build . -t netprobify | ||
# | ||
# Run the image: docker run -it --rm --network host -v "$PWD/config.yaml":/opt/netprobify/config.yaml --name "netprobify" netprobify | ||
# | ||
|
||
FROM python:3.7.1-alpine3.8 | ||
FROM python:3.9 | ||
|
||
RUN apt update | ||
RUN apt install -y tcpdump | ||
RUN apt clean | ||
|
||
COPY netprobify /opt/netprobify/netprobify | ||
COPY requirements /opt/netprobify/requirements | ||
COPY netprobify_start.py /opt/netprobify/ | ||
COPY VERSION /opt/netprobify/ | ||
|
||
# BUILD PEX | ||
COPY . /tmp/netprobify | ||
WORKDIR /tmp/netprobify | ||
RUN pip install tox | ||
RUN /usr/local/bin/tox -e bundle | ||
WORKDIR /opt | ||
RUN mv /tmp/netprobify/dist/netprobify ./ | ||
WORKDIR /opt/netprobify | ||
RUN pip install -r requirements/netprobify.txt | ||
|
||
# CLEANING | ||
RUN pip uninstall -y tox six toml virtualenv filelock pluggy py | ||
RUN rm -rf /tmp/netprobify | ||
|
||
CMD [ "python", "/opt/netprobify" ] | ||
CMD [ "python", "/opt/netprobify/netprobify_start.py" ] |