docker镜像实战--10月16日

搭建镜像仓库

docker run -d -p 5000:5000 -v /usr/local/registry:/var/lib/registry --restart=always --name registry registry:2

Dockerfile指令


FROM centos:7

ADD entrypoint.sh /root

USER root

RUN yum install -y wget vim
RUN yum install -y vim wget
RUN yum install -y wget vim git
RUN yum install -y wget
RUN yum install -y openssh-server openssl
RUN yum install wget vim
RUN yum install git vim

WORKDIR /root


ENTRYPOINT ["/bin/bash", "/root/entrypoint.sh"]

多阶段构建

FROM centos:6.9 as builder

# 下载基础工具
RUN echo "this is a test" > frank.tar


FROM busybox

WORKDIR /root

COPY --from=builder frank.tar .