I built a docker image using the following Dockerfile
:
FROM continuumio/miniconda3
ENTRYPOINT [ “/bin/bash”, “-c” ]
ADD angular_restplus.yaml angular_restplus.yaml
RUN ["conda", "env", "create", "-f", "angular_restplus.yaml"]
RUN ["/bin/bash", "-c", "source activate work"]
COPY json_to_db.py json_to_db.py
CMD ["gunicorn", "-b", "0.0.0.0:3000", "json_to_db:app"]
and command to build it:
sudo docker build -t testimage:latest .
That runs through:
Step 5/7 : RUN ["/bin/bash", "-c", "source activate work"]
---> Running in 45c6492b1c67
Removing intermediate container 45c6492b1c67
---> 5b5604dc281d
Step 6/7 : COPY json_to_db.py json_to_db.py
---> e5d05858bed1
Step 7/7 : CMD ["gunicorn", "-b", "0.0.0.0:3000", "json_to_db:app"]
---> Running in 3ada6fd24d09
Removing intermediate container 3ada6fd24d09
---> 6ed934acb671
Successfully built 6ed934acb671
Successfully tagged testimage:latest
However, when I now try to use it, it does not work; I tried:
sudo docker run --name testimage -d -p 8000:3000 --rm testimage:latest
which seems to work fine as it prints
b963bdf97b01541ec93e1eb7
However, I cannot access the service in my browser and using
sudo docker ps -a
only shows the intermediate containers needed to create the image from above.
When I try to run it without the -d
flag, I get
gunicorn: 1: [: “/bin/bash”,: unexpected operator
Does that mean that I have to change the ENTRYPOINT
again? If so, to what?