1.docker安装
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
如果报错:Problem: package docker-ce-3:19.03.4-3.el7.x86_64 requires containerd.io >= 1.2.2-3 那就先装新版的 containerd.io
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
然后
sudo yum install docker-ce docker-ce-cli
sudo systemctl start docker
docker --version
设置开机自动启动
sudo systemctl enable docker
2.安装gitlab
拉取gitlab-ce镜像
docker pull gitlab/gitlab-ce:latest
启动gitlab
docker run -d --name gitlab --hostname master --restart always -p 4443:443 -p 8888:80 -p 2222:22 -v /data/docker/gitlab/c
onfig:/etc/gitlab -v /data/docker/gitlab/data:/var/opt/gitlab -v /data/docker/gitlab/logs:/var/log/gitlab gitlab/gitlab-ce:lat
est
在浏览器中输入ip:8888,修改密码,此密码对应的用户名为root
3.安装pypiserver
docker run --name 'pypi' --restart always -v /data/pypi/packages:/data/packages -p 2080:8080 -d pypiserver/pypiserver -P . -a . packages
安装成功后打包长传
python setup.py bdist_wheel upload -r http://ip:2080
会有提示错误:
500: Internal Server Error" Package upload appears to have failed
这时需要修改文件权限:
docker exec -it --user root pypi /bin/sh
chmod 777 -R packages
执行命令后再次打包长传,成功了,此时在浏览器输入
http://ip:2080/packages/
就能看到刚上传的包了,安装就只需要输入
pip install -i http:ip:2080/simple/ xx(包) --trusted-host ip:2080