-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (32 loc) · 1.27 KB
/
Dockerfile
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
ARG MARINE_CORE_TAG=marine
FROM tomlegkov/marine-core:$MARINE_CORE_TAG as builder
WORKDIR /marine-python
COPY setup.py setup.cfg ./
COPY README.md ./
COPY LICENSE ./
COPY marine ./marine
ENV PY="/opt/python/cp38-cp38/bin/python"
RUN mkdir -p marine/.ws/data && \
rsync -L --exclude idl2wrs --exclude 'lib*.so*' --exclude 'plugins*' --exclude 'marine_*' --exclude tshark --exclude '*.html' --exclude 'lib*.a' /build/run/* marine/.ws/data/ && \
mkdir marine/.ws/libs && \
rsync -L /build/run/libmarine.so /build/run/lib*so.0 marine/.ws/libs/ && \
$PY setup.py bdist_wheel --dist-dir /tmp
WORKDIR /dist
COPY scripts /scripts
RUN /scripts/expose_auditwheel.sh && \
$PY /scripts/modify_auditwheel_policy.py && \
/scripts/patch_auditwheel_recursive_dependency_bug.sh
RUN auditwheel repair --plat manylinux2014_x86_64 -w /dist /tmp/marine*.whl
FROM centos/python-38-centos7
USER root
RUN yum install -y libpcap && \
yum clean all && \
rm -rf /var/yum/cache
RUN pip install --no-cache-dir tox
COPY . /marine-python
WORKDIR /marine-python
COPY --from=builder /dist /dist
VOLUME /io
# --import-mode is a pytest option
# It makes pytest import marine from site-packages (wheel) and not from the repo
CMD tox --installpkg /dist/marine*.whl -- --import-mode append