dockce启动httpd+git
2021-04-10 21:26
标签:dev get sed 目录 初始化 awk pass docker egit conf目录下:主要copy的文件时httpd.conf,主要是配置apache可以访问到git并通过账号密码控制 [附件:git-team.htpasswd] FROM centos:centos7 #uyw-git: 是镜像名称。1.0是tag名称 docker run -d -it -p 10000:80 --name uyw-git -v dataVolumeGit1:/opt/http_git/gitpasswd uyw-git:1.0 dockce启动httpd+git 标签:dev get sed 目录 初始化 awk pass docker egit 原文地址:https://blog.51cto.com/ttxjs/2475837
git-team.htpasswd: 这个文件提供了初始化的用户,主要包含两个,分别是usertest/admin
[附件:httpd.conf]二、创建DockerFile
MAINTAINER Imagine Lin
ENV SSH_PASSWORD=P@ssw0rd
COPY git-team.htpasswd /opt/http_git/gitpasswd/git-team.htpasswd
RUN yum -y install git wget vim net net-tools grep awk sed exec httpd-2.4.6 httpd-devel-2.4.6 httpd-tools-2.4.6 && \
mkdir -p /opt/http_git/ud.git && \
cd /opt/http_git/ud.git && \
git init --bare && \
chown -R apache:apache /opt/http_git && \
chown apache:apache /opt/http_git/gitpasswd/git-team.htpasswd && \
chmod 640 /opt/http_git/gitpasswd/git-team.htpasswd
COPY conf /etc/httpd/conf
EXPOSE 80
CMD ["/usr/sbin/httpd","-D","FOREGROUND"]三、构建镜像
docker build -t uyw-git:1.0 .四、运行镜像