Trying to follow a few[1][2] simple Docker tutorials via AWS am and getting the following error:
> docker build -t my-app-image .
Sending build context to Docker daemon 94.49 MB
Step 1 : FROM amazon/aws-eb-python:3.4.2-onbuild-3.5.1
# Executing 2 build triggers...
Step 1 : ADD . /var/app
---> Using cache
Step 1 : RUN if [ -f /var/app/requirements.txt ]; then /var/app/bin/pip install -r /var/app/requirements.txt; fi
---> Running in d48860787e63
/bin/sh: 1: /var/app/bin/pip: not found
The command '/bin/sh -c if [ -f /var/app/requirements.txt ]; then /var/app/bin/pip install -r /var/app/requirements.txt; fi' returned a non-zero code: 127
Dockerfile:
# For Python 3.4
FROM amazon/aws-eb-python:3.4.2-onbuild-3.5.1
Which pip returns the following:
> which pip
./bin/pip
Relevant file structure:
.
├── Dockerfile
├── bin
│ ├── activate
│ ├── pip
│ ├── pip3
│ ├── pip3.5
│ ├── python -> python3
│ ├── python-config
│ ├── python3
│ ├── python3.5 -> python3
│ .
.
Again, noob in all things Docker so I'm not sure what troubleshooting steps to take. Please let me know what other helpful information I can provide.
which pip
from? Doesbin/pip
exist in the same directory as your Dockerfile? – jwodder Aug 22 '16 at 17:56pip
is not contained by the same directory as your Dockerfile (i.e., in the same directory or in a subdirectory thereof), it's nothing that will be available inside the container. The fact that you show pip as being in../myapp/bin
suggests that this is your problem. Consider truncating your Dockerfile to just theFROM
andADD
statements, then booting a shell in the resulting image and checking to see if things look like you expect. – larsks Aug 22 '16 at 18:18