You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.3 KiB

11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. docker-devpi
  2. ============
  3. This repository contains a Dockerfile for [devpi pypi server](http://doc.devpi.net/latest/).
  4. # Installation
  5. `docker pull muccg/docker-devpi`
  6. # Quickstart
  7. Start using
  8. ```bash
  9. docker run -d --name devpi \
  10. --publish 3141:3141 \
  11. --volume /srv/docker/devpi:/data \
  12. --env=DEVPI_PASSWORD=changemetoyoulongsecret \
  13. --restart always \
  14. muccg/docker-devpi
  15. ```
  16. Please set DEVPI_PASSWORD to a secret otherwise an attacker can *execute arbitrary code* in your application by uploading modified packages.
  17. # Persistence
  18. For devpi to preserve its state across container shutdown and startup you should mount a volume at `/data`. The quickstart command already includes this.
  19. # Client side usage
  20. To use this devpi cache to speed up your dockerfile builds, add use this snippit in your dockerfiles. This will add the devpi container an optional cache for pip:
  21. ```Dockerfile
  22. # Install netcat for ip route
  23. RUN apt-get update \
  24. && apt-get install -y netcat \
  25. && rm -rf /var/lib/apt/lists/*
  26. # Use an optional pip cache to speed development
  27. RUN export HOST_IP=$(ip route| awk '/^default/ {print $3}') \
  28. && mkdir -p ~/.pip \
  29. && echo [global] >> ~/.pip/pip.conf \
  30. && echo extra-index-url = http://$HOST_IP:3141/app/dev/+simple >> ~/.pip/pip.conf \
  31. && echo [install] >> ~/.pip/pip.conf \
  32. && echo trusted-host = $HOST_IP >> ~/.pip/pip.conf \
  33. && cat ~/.pip/pip.conf
  34. ```
  35. # Uploading files
  36. ```bash
  37. pip wheel --download=packages --wheel-dir=wheelhouse -r requirements.txt
  38. pip install "devpi-client>=2.3.0" \
  39. && export HOST_IP=$(ip route| awk '/^default/ {print $3}') \
  40. && if devpi use http://$HOST_IP:3141>/dev/null; then \
  41. devpi use http://$HOST_IP:3141/${DEVPI_USER:-app}/${DEVPI_INDEX:-dev} --set-cfg \
  42. && devpi login ${DEVPI_USER:-app} --password=$DEVPI_PASSWORD \
  43. && devpi upload --from-dir --formats=* ./wheelhouse ./packages; \
  44. else \
  45. echo No started devpi container found at http://$HOST_IP:3141; \
  46. fi
  47. ```
  48. # Security
  49. Devpi creates a user named root by default, its password can be set with DEVPI_PASSWORD environment variable. Please set it, otherwise attacker can *execute arbitrary code* in your application by uploading modified packages.
  50. For additonal security the argument `--restrict-modify root` has been added so only the root may create users and indexes.