upgrading the pip version in dockerized django container

32 views
Skip to first unread message

Shubham Joshi

unread,
Apr 10, 2019, 5:56:53 AM4/10/19
to Django users
I am trying to upgrade pip version in docker


snj@snj-ThinkPad-T440p:~/school$ sudo docker-compose run web pip install --upgrade pip
Starting school_db_1 ... done
Collecting pip
    100% |████████████████████████████████| 1.4MB 62kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-19.0.3
snj@snj-ThinkPad-T440p:~/school$ sudo docker-compose run web pip --version
Starting school_db_1 ... done
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
snj@snj-ThinkPad-T440p:~/school$

nm

unread,
Apr 10, 2019, 9:24:55 AM4/10/19
to Django users

Try `exec` instead of `run`. `run` runs the command in a new container, so each time you perform `docker-compose run web <command>`, a new copy of the container is created. See the documentation: https://docs.docker.com/compose/reference/run/
Reply all
Reply to author
Forward
0 new messages