05 非正常应用方式启动的镜像制作

旧巷老猫 提交于 2019-12-29 23:36:47

非正常应用方式启动的镜像制作,其实就是制作一些不是默认使用rpm安装的程序镜像
目前市场上很多都是jar 包启动,所以启动的方式也不能按照正常来进行

下面将以两种镜像制作例子展示:

第一种方式:

build.sh

#!/bin/bash
docker build -t docker.anyonedev.com/public/httpd:2.4.6 .
docker push docker.anyonedev.com/public/httpd:2.4.6

httpd-foreground

#!/bin/sh
set -e

# Apache gets grumpy about PID files pre-existing
rm -f /usr/local/apache2/logs/httpd.pid

exec httpd -DFOREGROUND

Dockerfile

FROM docker.anyonedev.com/public/centos:7.4.1708

ENV TZ "Asia/Shanghai"

RUN yum install -y httpd-2.4.6-89.el7.centos

EXPOSE 80

COPY httpd-foreground /usr/local/bin/

CMD ["httpd-foreground"]

第二种方式:

在这里插入图片描述

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!