github.com/didip/deis@v1.4.1/registry/build.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # fail on any command exiting non-zero
     4  set -eo pipefail
     5  
     6  if [[ -z $DOCKER_BUILD ]]; then
     7    echo
     8    echo "Note: this script is intended for use by the Dockerfile and not as a way to build the registry locally"
     9    echo
    10    exit 1
    11  fi
    12  
    13  DEBIAN_FRONTEND=noninteractive
    14  
    15  sed -i 's/main$/main universe/' /etc/apt/sources.list
    16  
    17  # install required packages (copied from dotcloud/docker-registry Dockerfile)
    18  apt-get update && \
    19      apt-get install -y git-core build-essential python-dev \
    20      libevent-dev libssl-dev libyaml-0-2 libyaml-dev python-openssl liblzma-dev swig
    21  
    22  # install pip
    23  curl -sSL https://raw.githubusercontent.com/pypa/pip/6.0.8/contrib/get-pip.py | python -
    24  
    25  # create a registry user
    26  useradd -s /bin/bash registry
    27  
    28  # add the docker registry source from github
    29  git clone -b new-repository-import-v091 --single-branch https://github.com/deis/docker-registry /docker-registry && \
    30      chown -R registry:registry /docker-registry
    31  
    32  # install boto configuration
    33  cp /docker-registry/config/boto.cfg /etc/boto.cfg
    34  cd /docker-registry && pip install -r requirements/main.txt
    35  
    36  # Install core
    37  pip install /docker-registry/depends/docker-registry-core
    38  
    39  # Install registry
    40  pip install file:///docker-registry#egg=docker-registry[bugsnag,newrelic,cors]
    41  
    42  patch \
    43   $(python -c 'import boto; import os; print os.path.dirname(boto.__file__)')/connection.py \
    44   < /docker-registry/contrib/boto_header_patch.diff
    45  
    46  # cleanup. indicate that python is a required package.
    47  apt-mark unmarkauto python python-openssl libyaml-0-2 && \
    48    apt-get remove -y --purge git-core build-essential libssl-dev libyaml-dev python-dev swig && \
    49    apt-get autoremove -y --purge && \
    50    apt-get clean -y && \
    51    rm -Rf /usr/share/man /usr/share/doc && \
    52    rm -rf /tmp/* /var/tmp/* && \
    53    rm -rf /var/lib/apt/lists/*