#这个是我自己做的centos基础镜像做底层
FROM centos:7
ADD CentOS-Base.repo /etc/yum.repos.d/
#定义nginx变量,下载的时候根据变量来下载最新的nginx版本
ENV NGINX_VERSION 1.9.9
RUN
yum install -y wget &&
yum install -y gcc zlib zlib-devel pcre-devel openssl openssl-devel vim ss &&
yum clean all &&
cd /tmp &&
wget http://nginx.org/download/nginx-KaTeX parse error: Expected 'EOF', got '&' at position 24: …ERSION}.tar.gz &̲& \ tar…{NGINX_VERSION} &&
./configure --prefix=/etc/nginx &&
make &&
make install &&
cd /tmp &&
rm -rf /tmp/nginx-${NGINX_VERSION} &&
true
#定义端口为 80 81 82 83 ,以便一个机器上可以开放多个端口
EXPOSE 80
EXPOSE 81
EXPOSE 82
EXPOSE 83
CMD [ “/etc/nginx/sbin/nginx”, “-g”, “daemon off;”]
$ docker image inspect --format='{{.RepoTags}} {{.Id}} {{.Parent}}' $(docker image ls -q --filter since=66cd24df2cea)
[172.xx.xx.xx:xxxx/python:v2] sha256:5e4f8802127ca53b4fa997791779de2abd6952abb87cc8b4bf2fba34ee42e205 sha256:963db9e8c7674e8cd2eaec44086146793118ee0d291df6a9c79e1ea851147dd0