forked from 0k/0k-charms
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.
43 lines
678 B
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
|
|
|
|
|
|
|