Docker安装Git

拉取git镜像
docker pull gitlab/gitlab-ce:latest

在宿主机创建git目录用于挂载git容器内部目录

mkdir -p /opt/gitlab/etc
mkdir -p /opt/gitlab/log
mkdir -p /opt/gitlab/data

启动Git

 docker run --name gitlab -d  
--publish 9443:443 --publish 98080:80 
--restart always 
-v /opt/gitlab/etc:/etc/gitlab 
-v /opt/gitlab/log:/var/log/gitlab 
-v /opt/gitlab/data:/var/opt/gitlab 
--privileged=true 
gitlab/gitlab-ce:latest

查看Git是否启动成功

docker ps

你可能感兴趣的:(Docker安装Git)