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

Unable to include python-pip packages it is always removing those packages #13

Closed
bisshwajitsamanta opened this issue Jun 14, 2018 · 2 comments

Comments

@bisshwajitsamanta
Copy link

bisshwajitsamanta commented Jun 14, 2018

Dockerfile::-

FROM ubuntu:latest
RUN apt-get update && apt-get install -y ssh iproute2 iputils-ping python python-pip python3.4 python3-pip git
RUN pip install paramiko nose PrettyTable

Command which i am running ..

minidock -i sanity_test:v2 -t sanity_test:v5 --apt -E bash -E 'ssh localhost' -E ip -E id -E curl -E vim -E git -E cat -E ls -E /usr/local/lib/python2.7/dist-packages/ -E python -E python3 -E pip -E pip3 -E rm -E mkdir -E 'ping -c 1 www.google.co.in' -E wget

Image size is drastically getting reduced but missed python pip packages

Post Changes i am not able to find the pip packages

root@devops-02:/opt/minicon# docker run -it sanity_test:v5 bash
bash-4.4# python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import paramiko
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named paramiko

@bisshwajitsamanta
Copy link
Author

Any update please?

@dealfonso
Copy link
Member

Hi,

when you include a whole folder (as I think that you try with -E /usr/local/lib/python2.7/dist-packages/), you need to use flag -I instead of -E. So your commandline will be the next one:

minicon -i sanity_test:v2 -t sanity_test:v5 --apt -E bash -E 'ssh localhost' -E ip -E id -E curl -E vim -E git -E cat -E ls -I /usr/local/lib/python2.7/dist-packages -I /usr/lib/python2.7 -E python -E python3 -E pip -E pip3 -E rm -E mkdir -E 'ping -c 1 www.google.co.in' -E wget

Please notice that in this case will you also need to include the folder /usr/lib/python2.7 to have __future__.py which is needed by paramiko.

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

2 participants