我正在尝试运行一个由这个Dockerfile创建的Docker容器
FROM selenium/standalone-chrome
WORKDIR /app
# Install dependencies
USER root
RUN apt-get update && apt-get install python3-distutils -y
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3 get-pip.py
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
RUN pip install selenium==4.1
# Copy src contents
COPY /src /app/
# Expose the port
EXPOSE 8501
# Execution
ENTRYPOINT [ "streamlit", "run" ]
CMD ["app.py"]构建这个容器是可能的,但是当我执行映像时,我会得到以下消息:
Welcome to Streamlit!
If you're one of our development partners or you're interested in getting
personal technical support or Streamlit updates, please enter your email
address below. Otherwise, you may leave the field blank.
Email: 2022-06-06 09:20:27.690 因此,当执行停止时,我无法按enter并继续执行。你们知道我应该如何让我的Dockerfile直接执行streamlit run命令并超越这个问题吗?
发布于 2022-06-21 07:19:49
当不存在具有以下内容的~/.streamlit/credentials.toml文件时,将显示该欢迎消息:
[general]
email=""您可以在应用程序目录中创建上述文件(.streamlit/credentials.toml)并将其内容复制到Dockerfile中的容器映像中,也可以使用以下运行命令创建该文件:
mkdir -p ~/.streamlit/
echo "[general]" > ~/.streamlit/credentials.toml
echo "email = \"\"" >> ~/.streamlit/credentials.toml我建议采用前一种方法来减少层数,从而减少最终图像大小。
https://stackoverflow.com/questions/72515604
复制相似问题