Confusing error message when run in Dockerfile
See original GitHub issueWhen experimenting in a Dockerfile, I hit an odd error message:
Creating a virtualenv for this project…
usage: pew [-h] [-p PYTHON] [-i PACKAGES] [-r REQUIREMENTS] [-d] [-a PROJECT]
envname
pew: error: the following arguments are required: envname
Virtualenv location:
Creating a Pipfile for this project…
Creating a virtualenv for this project…
usage: pew [-h] [-p PYTHON] [-i PACKAGES] [-r REQUIREMENTS] [-d] [-a PROJECT]
envname
pew: error: the following arguments are required: envname
Virtualenv location:
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
An unexpected error occurred while accessing your virtualenv's python installation!
Please run $ pipenv --rm to re-create your environment.
Obviously a Dockerfile is a pathological environment to be running in (and I’ve moved on to resolve the issue), but it feels like pipenv should abort much earlier than it did
Describe your environment
- OS Type: ubuntu:16.04
- Python version: 3.5
- Pipenv version: latest from PyPI
Expected result
Error message explaining the actual issue.
Actual result
Above error message.
Steps to replicate
Attempt to build this Dockerfile:
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y python3-pip
RUN pip3 install pipenv
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN pipenv install --deploy --verbose
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Can you make any sense of Dockers error-messages?
First check Docker file name(D should be capital), then run docker build -f Dockerfile . (dot ...
Read more >How to properly override the ENTRYPOINT using docker run
Well the documentation clearly states that the ENTRYPOINT only specifies the executable to run, when the container starts. So they get an error...
Read more >Why new Macs break your Docker build, and how to fix it
So it can be a little confusing when you try to build your Python-based Dockerfile on a new Mac, and everything starts failing....
Read more >Docker Compose release notes
Bug fixes and enhancements . Added a quiet option when pushing an image. Fixed compose#9089; Fixed a misleading error message for port...
Read more >Debugging a weird 'file not found' error - Julia Evans
Let's start by showing the error message I got. ... docker run -it broken-container:latest /app/serve standard_init_linux.go:228: exec user ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can we reopen this?
I disagree that Docker is “a pathological environment”! In particular, if Pipenv doesn’t work out of the box with an official Python Docker image, something is wrong (though I’m not sure whether it’s the image or Pipenv that should be fixed.)
FWIW, here’s my repro:
Output:
In case it helps others I was able to solve this issue by setting
WORKDIR
to/opt/app
: