43 lines
678 B

#!/bin/bash
set -eux # -x for verbose logging to juju debug-log
apt-get -y install python-dev python-pip liblzma-dev
pip install docker-registry
##
## System user & permissions
##
adduser --system --home=/var/lib/docker --group docker
chown docker:docker /var/lib/docker-registry -R
##
## Init.d and defaults running options
##
cp src/etc/init.d/docker-registry /etc/init.d/
cp src/etc/default/docker-registry /etc/default/
update-rc.d docker-registry defaults
##
## Logrotate
##
cat <<EOF > /etc/logrotate.d/docker-registry
/var/log/docker-registry.log {
daily
rotate 7
delaycompress
compress
notifempty
missingok
}
EOF