Public | Automated Build

Last pushed: 6 months ago
Short Description
pypi caching service using devpi and docker
Full Description

Devpi Dockerfile

This repository contains Dockerfile of Devpi for Docker's trusted build published to the public Docker Registry.

Dependencies

Installation

  1. Install Docker.

  2. Download trusted build from public Docker Registry: docker pull scrapinghub/devpi

    (alternatively, you can build an image from Dockerfile: docker build -t="scrapinghub/devpi" github.com/scrapinghub/docker-devpi)

Usage

Run devpi-server
docker run -d --name devpi -p 3141:3141 scrapinghub/devpi

Devpi creates a user named root by default, its password can be set with
DEVPI_PASSWORD environment variable.

Run devpi-server with Fully Configured LDAP Support

The devpi-ldap plugin comes pre-installed in the Docker image with a couple of options for configuring LDAP in the devpi instance:

  1. Specify a devpi-ldap YAML configuration file using the DEVPI_LDAP_CONFIG_PATH environment variable (see
    the documentation for devpi-ldap). Note that the path must be an absolute path accessible within the docker container:

     docker run -d --name devpi -p 3141:3141 \
       -v /your/devpi_data/dir:/mnt \
       -e DEVPI_LDAP_CONFIG_PATH=/mnt/ldap-config.yml \
       scrapinghub/devpi
    
  2. Specify the LDAP configurations using environment variables and let the dockerfile generate the configuration for you:

     docker run -d --name devpi -p 3141:3141 \
       -e LDAP_HOST_URL=ldap://example.com \
       -e LDAP_USER_TEMPLATE="CN={username},CN=Partition1,DC=Example,DC=COM" \
       -e LDAP_GROUP_SEARCH_BASE="CN=Partition1,DC=Example,DC=COM" \
       -e LDAP_GROUP_SEARCH_FILTER="(&(objectClass=group)(member={userdn}))" \
       -e LDAP_GROUP_SEARCH_ATTR_NAME="CN" \
       scrapinghub/devpi
    
Run devpi-server with devpi-server Import

You can initialize the DEVPI_SERVERDIR from a directory created using a devpi-server --export command by using the DEVPI_IMPORT_DIR variable (the DEVPI_PASSWORD variable will be ignored):

 docker run -d --name devpi -p 3141:3141 \
  -v /your/devpi_data/dir:/mnt \
  -e DEVPI_IMPORT_DIR=/mnt/devpi-export/ \
  scrapinghub/devpi

Available Configurations

The following environment variables are exposed to automate as much of the setup and configuration process as possible:

  • DEVPI_PASSWORD: the devpi root account password. Will be ignored if DEVPI_IMPORT_DIR is specified.
  • OUTSIDE_URL: equates to the --outside-url option for the devpi-server command
  • RESTRICT_MODIFY: equates to the --restrict-modify option for the devpi-server command
  • DEVPI_IMPORT_DIR: triggers an import using the devpi-server's --import option before starting the server if (and only if) no devpi-server data exists at DEVPI_SERVERDIR (/mnt/devpi-server). The DEVPI_PASSWORD variable will be ignored since the root account (including password) should be imported from the export data
LDAP
  • DEVPI_LDAP_CONFIG_PATH: absolute path to a YAML configuration file containing the desired devpi-ldap configuration. This will take precedence over environment variable configuration if both this and the LDAP_HOST_URL options are specified
  • LDAP_HOST_URL: equates to the url parameter in the devpi-ldap YAML configuration file. The YAML file pointed to DEVPI_LDAP_CONFIG_PATH will take precedence if both LDAP_HOST_URL and DEVPI_LDAP_CONFIG_PATH are passed
  • LDAP_USER_TEMPLATE: equates to the user_template parameter in the devpi-ldap YAML configuration file. This will take precedence over any of the user_search parameters if LDAP_USER_TEMPLATE and any of the user_search variables are specified
  • LDAP_USER_SEARCH_BASE: equates to the user_search/base parameter in the devpi-ldap YAML configuration file. Will be ignored if LDAP_USER_TEMPLATE is specified
  • LDAP_USER_SEARCH_FILTER: equates to the user_search/filter parameter in the devpi-ldap YAML configuration file. Will be ignored if LDAP_USER_TEMPLATE is specified
  • LDAP_USER_SEARCH_ATTR_NAME: equates to the user_search/attribute_name parameter in the devpi-ldap YAML configuration file. Will be ignored if LDAP_USER_TEMPLATE is specified
  • LDAP_GROUP_SEARCH_BASE: equates to the group_search/base parameter in the devpi-ldap YAML configuration file
  • LDAP_GROUP_SEARCH_FILTER: equates to the group_search/filter parameter in the devpi-ldap YAML configuration file
  • LDAP_GROUP_SEARCH_ATTR_NAME: equates to the group_search/attribute_name parameter in the devpi-ldap YAML configuration file
Docker Pull Command
Owner
xetusoss
Source Repository

Comments (0)