gpt4 book ai didi

docker - 如何在没有docker文件存在的情况下构建docker镜像

转载 作者:行者123 更新时间:2023-12-02 20:49:58 24 4
gpt4 key购买 nike

Docker的新手。

运行这个docker build .
这是Dockerfile

FROM gcr.io/google_appengine/python

# Create a virtualenv for dependencies. This isolates these packages from
# system-level packages.
RUN virtualenv /env

# Setting these environment variables are the same as running
# source /env/bin/activate.
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH

# Copy the application's requirements.txt and run pip to install all
# dependencies into the virtualenv.
#ADD requirements.txt /app/requirements.txt
#RUN pip install -r /app/requirements.txt

# Add the application source code.
ADD . /app

# Run a WSGI server to serve the application. gunicorn must be declared as
# a dependency in requirements.txt.
CMD gunicorn -b :$PORT main:app

CMD bash1 "while true; do echo hello; sleep 1;done"

CMD ["sh", "while true; do echo hello; sleep 1;done"]
CMD "echo" "Hello docker!"

但是之后,当我运行 docker ps时,我看不到图像。

最佳答案

使用'docker run'创建和运行容器。 docker构建所要做的就是创建一个镜像。

关于docker - 如何在没有docker文件存在的情况下构建docker镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40575206/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com