compile in docker multistage

Open
#180 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, python

Research direction

Review the multistage Docker build, especially the python setup.py install step and the final COPY commands for the Python package and libyara. Reproduce the final image and compare its Python installation and import path with the builder stage. Done means the reduced image can run import yara successfully.

Written by the indexing model from the issue text.

Description

Hello,
would like to know what are the right lib to copy after compiled yara && yara-python from sources.

FROM base-builder as yara-builder
RUN cd /tmp/ \
  && git clone --recursive https://github.com/VirusTotal/yara.git \
..
..
&& make install \
..
  && git clone --recursive https://github.com/VirusTotal/yara-python \
..
...
  && python setup.py install \

at the end :

COPY --from=yara-builder /usr/local/lib/python3.8/site-packages/yara_python-4.1.0-py3.8-linux-x86_64.egg /usr/local/lib/python3.8/site-packages/yara_python-4.1.0-py3.8-linux-x86_64.egg
COPY --from=yara-builder /usr/local/lib/libyara* /usr/local/lib/

but if I try in python to import yara I get ModuleNotFoundError: No module named 'yara'
(Instead if I try inside docker image to follow same step I used to compile, it works with any issue)

There is any other library/file to copy from compiler stage to the final stage?
Thanks

Dominant language
C
Stars
754
Forks
190
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VirusTotal/yara-python

All issues in VirusTotal/yara-python

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.