docker与jenkins的自动化CI/CD流水线实战(php-svn)

环境需求

docker与jenkins的自动化CI/CD流水线实战(php-svn)

编写dockerfile

备注:内容太长,写在本身的电脑上了
流程:
一、yum安装基础服务,如gcc,make,openssl
二、nginx1.14.0安装
三、php-7.1.19安装
四、supervisord监听nginx,php服务
五、#docker防止中文乱码
六、安装crontabs 服务
echo "/1 * bash /data/shell/check_supervisord.sh >> /root/check_supervisord.log" >> /var/spool/cron/root
七、必须 要将crond给自启动,否则进入容器仍是不执行
RUN systemctl enable crondphp

build

docker与jenkins的自动化CI/CD流水线实战(php-svn)

docker build -t 192.168.1.232/library/nginx-php:v1.14_v7.1.19 -f Dockerfile-nginx-php .nginx

docker_run

docker run --privileged -itd --name php-test4 --mount type=bind,src=/data/www,dst=/data/www --mount type=bind,src=/mnt,dst=/mnt -p 801:80 192.168.1.232/library/nginx-php:v1.14_v7.1.19 docker

查看:docker ps -l
进入容器:ps -ef 看是否正常启动shell

错误:
[root@b78ec7459ebb php-7.1.19]# systemctl start supervisord
Failed to get D-Bus connection: Operation not permittedbash

解决:
docker run --privileged -itd --name php-test4 --mount type=bind,src=/data/www,dst=/data/www --mount type=bind,src=/mnt,dst=/mnt -p 801:80 192.168.1.232/library/nginx-php:v1.14_v7.1.19 ide

错误:
为何建立容器,不执行crontab -l的内容呢svn

解决:dockerfile 时须要将systemctl enable crond 开机启动ui

相关文章
相关标签/搜索