Issue
I have created one flask app using yolo model. My app is using following libraries and I have stored them in requirements.txt
file.
pandas
numpy
matplotlib
seaborn
streamlit
boto3
opencv-python
ultralytics
flask
easyocr
I am specifying my Dockerfile code below
COPY . /application
WORKDIR /application
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 unzip -y && pip install -r requirements.txt
CMD ["python", "application.py"]`
Now when I was trying to pushing the code in docker hub. It had been pushed properly. My flask app was running on port 8080 and host is 0.0.0.0
After pushing it into docker hub I was running the following code in my git bash by using the below command.
docker run -it -p 8080:8080 -t <container_name> .
I was getting the following error.
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: ".": executable file not found in $PATH: unknown.
I did not understand the issue how can i resolve it?
I tried to install ffmpeg and some other stuffs inside docker. I tried to follow some stack over flow and github community discussions but still it was not solved as those discussions are not perfectly matching with my current situation.
Solution
To run the command specified in the Dockerfile (i.e. python application.py
):
docker run -p 8080:8080 <image_name>
To run the command specified in the Dockerfile and see its output as it runs:
docker run -p 8080:8080 -t <image_name>
To run an interactive shell inside the docker container (e.g. for debugging):
docker run -p 8080:8080 -ti <image_name> /bin/sh
The command that you provided tries to run a program called .
, which does not exist. The t
flag is used to allocate a terminal to the container, while the i
flag makes it interactive.
Answered By - renzev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.