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