docker 05 非正常應用方式啓動的鏡像製作

非正常應用方式啓動的鏡像製作,其實就是製作一些不是默認使用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"]

第二種方式:

在這裏插入圖片描述

博主個人博客網址 :http://blog.doveop.com/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章