学习docker实操就是打包程序,现在以打包Grafana为例:
dockerfile

FROM centos7.4/centos7.4:version1.0 
MAINTAINER believer <940847060@qq.com>
LABEL Descripttion="This image is build for grafana"
RUN mkdir -p /usr/local/promethues/
ADD grafana-7.1.5.tar.gz /usr/local/promethues/
WORKDIR /usr/local/promethues/grafana-7.1.5/
ENV LANG C.UTF-8
ENV TZ=Asia/Shanghai
EXPOSE 3000

打包镜像过程

Docker实战之打包Grafana程序打包_centos


运行容器:

Docker实战之打包Grafana程序打包_程序实践_02


验证服务:

Grafana界面可以正常打开

Docker实战之打包Grafana程序打包_docker_03


docker打包程序实践完毕!