1

I am trying to deploy a docker container to Elastic Beanstalk in AWS. I'm repeatedly getting error while doing so and each time the error is related to the ENTRYPOINT that I specified in the dockerrun.aws.json. What am I doing wrong here ?

The webapp uses Django, python3 and keras.

This is my Dockerfile content:

# reference: https://hub.docker.com/_/ubuntu/
FROM ubuntu:18.04

RUN apt-get update && apt-get install \
  -y --no-install-recommends python3 python3-virtualenv

# Adds metadata to the image as a key value pair example LABEL     
version="1.0"
LABEL maintainer="Amir Ashraff <amir.ashraff@gmail.com>"

##Set environment variables
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m virtualenv --python=/usr/bin/python3 $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Install dependencies:
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Open Ports for Web App
EXPOSE 8000

WORKDIR /manage.py

COPY . /manage.py
RUN chmod +x /manage.py
ENTRYPOINT [ "python3" ]
CMD [ "python3", "manage.py runserver 0.0.0.0:8000" ]

And this is the dockerrun.aws.json content:

{
  "AWSEBDockerrunVersion": "1",

  "Ports": [
    {
      "ContainerPort": ""
    }
  ],
  "Volumes": [
    {
      "HostDirectory": "/~/aptos",
      "ContainerDirectory": "/aptos/diabetes_retinopathy_recognition"
    }
  ],
  "Logging": "/aptos/diabetes_recognition",
  "Entrypoint": "/opt/venv/bin/python3",
  "Command": "python3 manage.py runserver 0.0.0.0:8000"
}

And this is the error from AWS logs:

Docker container quit unexpectedly on Tue Aug 20 13:03:47 UTC 2019: 
/opt/venv/bin/python3: can't open file 'python3': [Errno 2] No such file 
or directory.
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
morelloking
  • 193
  • 1
  • 3
  • 11

0 Answers0