DOCKER 基础镜像
转至元数据结尾
1、不带jdk的基础镜像的dockerfile
FROM ubuntu
MAINTAINER lstar [email protected]
#更换源可以是阿里云、网易、搜狐的源,默认源也可以就是比较慢
ADD sources.list /etc/apt/sources.list
RUN apt-get update&& apt-get install -y net-tools confluence supervisor rsyslog&& rm -rf /var/cache/apt/archives/*
#添加时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
docker image创建命令
docker build -t 192.168.0.45:5000/basenojdk .
docker push 192.168.0.45:5000/basenojdk
2、带jdk的基础镜像的dockerfile
FROM 192.168.0.45:5000/basenojdk
MAINTAINER lstar [email protected]
RUN apt-get update&& apt-get install -y openjdk-8-jdk && rm -rf /var/cache/apt/archives/*
docker image创建命令
docker build -t 192.168.0.45:5000/base .
docker push 192.168.0.45:5000/base
3、elink 基础镜像
FROM ubuntu:16.04
MAINTAINER lstar [email protected]
ADD sources.list /etc/apt/sources.list
RUN apt-get update&& apt-get install -y net-tools python-dateutil confluence supervisor libssl-dev rsyslog&& rm -rf /var/cache/apt/archives/*
#添加时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
docker image创建命令
docker build -t 192.168.0.45:5000/baseelink .
docker push 192.168.0.45:5000/baseelink标签:5000,基础,apt,192.168,&&,镜像,DOCKER,0.45,docker From: https://www.cnblogs.com/hanwei666/p/17352703.html