Streamlit + docker not working

Hi,
I´m trying to dockerize an app made with streamlit but I´ve tried for four days so far and nothing has worked for me.
It takes ages to build the image and when I try to run it, it returns: /bin/sh: 1: streamlit: not found .
This is my docker file (This is my first time using docker )

FROM continuumio/miniconda3

ENV LC_ALL=C.UTF-8

ENV LANG=C.UTF-8

RUN mkdir -p /root/.streamlit

RUN bash -c 'echo -e "\

WORKDIR /ModelosComercio

EXPOSE 8501

ADD environment.yml .

RUN conda env create --file environment.yml

CMD streamlit run ModelosStreamlit.py

Any help will be apreciated.

Thanks

Hi @Maria_Isabel_Meneses,

Thanks for posting!

Have you checked out our new doc on deploying with Docker?

Caroline :balloon:

Not actually but I´m working with conda. Would it be the same if instead of “environment.yml” I try to install “requirements.txt” with pip?
I´ve tried with pip and I get the same error so I don´t really know how to handle this pip/conda thing

I´ve just follow the new doc and I get this error when I try to do it with my project: docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: “streamlit”: executable file not found in $PATH: unknown.

What can I do?

Have you tried following the doc (i.e. using the exact Dockerfile and docker run command in the doc and using pip and requirements.txt instead of conda?

Yes, I´ve tried with pip and requirements.txt. Same result

I’m at a loss as I’m unable to reproduce the behavior. I’ll defer to the rest of the community for solutions :sweat_smile: