码头工人新手。
运行此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
时,我看不到图像。
答案 0 :(得分:2)
要构建您必须使用的图像:
X509Certificate2UI
您必须使用docker build -t username/imagename .
标记您的图片并从文档中为其命名:
-t, - tag value名称和可选的标签 'name:tag'格式(默认为[])
然后您可以使用以下方式查看图像列表:
-t
您使用docker images
用于列出容器而不是图片。
有关about images and containers的更多信息。
答案 1 :(得分:1)
使用'docker run'创建并运行容器。所有docker build都是创建一个图像。