Sign inSign up

daverona/pypiserver

By daverona

Updated about 6 years ago

Image
0

203

daverona/pypiserver repository overview

daverona/pypiserver

pipeline status

This is a repository for Docker images of pypiserver.

Quick Start

docker container run --rm \
  --detach \
  --publish 80:80 \
  --volume "${PWD}/packages:/packages" \
  --name pypiserver \
  daverona/pypiserver

Visit http://localhost and observe the pypiserver has no package to serve. To verify that pypiserver is working, make a .pypirc in your home directory first:

[distutils]
index-servers=
  pypiserver

[pypiserver]
repository:http://localhost
username:bogus
password:bogus

Although pypiserver does not authenticate its users, .pypirc is required even with bogus username and password.

Make a sample package of, say requests, and upload:

git clone https://github.com/psf/requests
cd requests
python3 setup.py sdist upload --repository pypiserver

Visit http://localhost again and observe our pypiserver has a single package to serve, namely requests package. Install the uploaded requests package from pypiserver:

pip3 install --index-url http://localhost/simple/ requests

Usage

To protect pypiserver, make a username and password pair first:

docker container run --rm daverona/pypiserver \ 
  htpasswd -n admin \
>> htpasswd
# enter password, say "secret", for username "admin"

Create htpasswd file and append the above output to htpasswd file.

The authentication is for listing, uploading, and updating packages. Each user who wants to use pypiserver needs a valid username and password pair. Do NOT share username/password among pypiserver users. Instead repeat the above step for each user.

Run pypiserver with htpasswd file bind-mounted:

docker container run --rm \
  --detach \
  --publish 80:80 \
  --volume "${PWD}/htpasswd:/etc/nginx/auth/htpasswd:ro" \
  --volume "${PWD}/packages:/packages" \
  --name pypiserver \
  daverona/pypiserver

Each pipyserver user need to create .pypirc under home directory with his/her own username and password:

[distutils]
index-servers= 
  pypiserver

[pypiserver]
repository:http://localhost
username:admin
password:secret

References

Tag summary

Content type

Image

Digest

Size

32.8 MB

Last updated

about 6 years ago

docker pull daverona/pypiserver