I am trying to build a CI/CD pipeline through Github Actions. I have created an Elastic Bean stalk environment to deploy a Python app with Docker as the platform. However, the docker image is failing to build when the workflow is run & providing error -
" Instance deployment failed to build the Docker image. The deployment failed.
9313:59:42 ERROR: Instance deployment failed. For details, see ‘eb-engine.log’.
When I build the image locally, it is getting successfully executed.
All the related files are in the same root directory.
Here is the Dockerfile for reference.
FROM python:3.9
Defining working directory and adding source code
RUN mkdir /hello-world-payments
WORKDIR /hello-world-payments
#COPY Pipfile Pipfile.lock bootstrap.sh application.py config.py /hello-world-payments/
COPY . /hello-world-payments/
#COPY bootstrap.sh /hello-world-payments/bootstrap.sh
RUN chmod +x bootstrap.sh
Installing packages
#RUN apk update
RUN pip install --no-cache-dir pipenv
Install API dependencies
RUN pipenv install --system --deploy
Start app
EXPOSE 5000
CMD [“./bootstrap.sh”]
As per eb-engine.log, the error message is,
[ERROR] An error occurred during execution of command [app-deploy] - [Docker Specific Build Application]. Stop running the command. Error: failed to build docker image: Command /bin/sh -c docker build -t aws_beanstalk/staging-app /var/app/staging/ failed with error exit status 1. Stderr:COPY failed: file not found in build context or excluded by .dockerignore: stat Pipfile: file does not exist
Please provide your valuable inupts