Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile in docker multistage #180

Open
garanews opened this issue Jun 17, 2021 · 1 comment
Open

compile in docker multistage #180

garanews opened this issue Jun 17, 2021 · 1 comment

Comments

@garanews
Copy link

garanews commented Jun 17, 2021

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

@garanews
Copy link
Author

Current "workaround I found" is launch install in the final stage:

COPY --from=yara-builder  /tmp/yara-python/ /tmp/
RUN  cd /tmp/ \
&& python setup.py install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant