1.建立帳號密碼檔案,並新增內容
touch /opt/pyserver/.htpasswd echo "username:password" > /opt/pyserver/.htpasswd
2.建立包路徑
mkdir /opt/pyserver/packages
3.建立私有倉庫
# 不帶轉發的命令 docker run --name pypi --restart always -v /opt/pyserver/packages:/data/packages -v /opt/pyserver/.htpasswd:/data/.htpasswd -p 8080:8080 -d pypiserver/pypiserver -P . -a . packages # 帶轉發地址的命令 docker run --name pypi --restart always -v /opt/pyserver/packages:/data/packages -v /opt/pyserver/.htpasswd:/data/.htpasswd -p 8080:8080 -d pypiserver/pypiserver -P . -a . packages --fallback-url https://pypi.doubanio.com/simple