win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)

安装docker 官网连接https://docs.docker.com/engine/examples/dotnetcore/#prerequisites

进入 https://download.docker.com/linux/centos/7/x86_64/stable/Packages/下载docker

docker 安装包需要下载三个  有两个依赖包

win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)_第1张图片

通过scp上传到centos服务器

win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)_第2张图片


win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)_第3张图片

添加docker 国内镜像仓库  国内免费镜像仓库官网 daocloud

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

该脚本可以将 --registry-mirror 加入到你的 Docker 配置文件 /etc/docker/daemon.json 中。适用于 Ubuntu14.04、Debian、CentOS6 、CentOS7、Fedora、Arch Linux、openSUSE Leap 42.1,其他版本可能有细微不同。更多详情请访问文档。

开机启动docker
$sudo systemctl start docker

$ sudo systemctl enable docker

win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)_第4张图片


If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with something like:

sudo usermod -aG docker your-user             --给非root用户添加权限

Remember to log out and back in for this to take effect!      --注销并重新登陆

接下来安装docker-compose  官方安装文档

sudo curl-L"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln-s/usr/local/bin/docker-compose /usr/bin/docker-compose

docker-compose--version


win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)_第5张图片

给gitlab-runner添加权限,不然自动发布不了

usermod -aG docker gitlab-runner

 sudo service docker restart 

win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七)_第6张图片

需要安装git

yum install git


win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(六)

win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(八)

你可能感兴趣的:(win10下hyper-v+centos7+gitlab+asp.net core+docker+docker-compose+持续集成(七))