Recommended way to install pip packages inside Dockerfile

whiteman808
Mon, 16 Mar 2026 06:15:47 +0000
Image Builds

Hello, I’m learning programming and I’m writing first Python application that does something useful, and practical. What is the recommended way to install pip packages when building Docker images? I’m asking because pip install complains about running itself as root. Do you recommend to create venv in Dockerfile? Thank you.

4 posts - 4 participants