Dockerfile构建镜像
构建镜像 构建镜像指令:docker build或docker image build Dockerfile 初识: cat >>Dockerfile<<end FROM python:2.7-slim WORKDIR /app ADD . /app RUN pip install -r requirements.txt EXPOSE 80 ENV NAME World CMD ["python", "app.py"] end yum install python2-pip 配置pip国内源 mkdir -p /root/.pip cat >> /root/.pip/pip.conf<<end [global] trusted-host=mirrors.aliyun.com index-url=http://mirrors.aliyun.com/pypi/simple/ end cat >>requirements.txt<<end Flask Redis end cat >> app.py<<end from flask import Flask from redis import Redis, RedisError import os import socket # Connect to Redis redis = Redis(host="redis", db=0,