Browse Source

finish packaging

master
parent
commit
f4c9763141
  1. 29
      docker-distribution/docker-distribution.spec
  2. 1
      docker-distribution/docker-registry.pwd
  3. 63
      docker-distribution/docker-registry.yml
  4. 8
      docker-distribution/rc.docker-distribution

29
docker-distribution/docker-distribution.spec

@ -42,10 +42,12 @@ Release: 20150624
Source0: http://download.openpkg.org/components/versioned/docker-distribution/docker-distribution-%{V_docker_distribution_snap}.tar.xz
Source1: rc.docker-distribution
Source2: docker-registry.yml
Source3: docker-registry.pwd
Source4: docker-passwd.sh
# build information
BuildPreReq: OpenPKG, openpkg >= 20140101, go
PreReq: OpenPKG, openpkg >= 20140101
BuildPreReq: OpenPKG, openpkg >= 20140101, go, apg
PreReq: OpenPKG, openpkg >= 20140101, x509, perl
%description
This is the Docker toolset to pack, ship, store, and deliver
@ -81,7 +83,7 @@ PreReq: OpenPKG, openpkg >= 20140101
$RPM_BUILD_ROOT%{l_prefix}/etc/docker-distribution \
$RPM_BUILD_ROOT%{l_prefix}/var/docker-distribution/run \
$RPM_BUILD_ROOT%{l_prefix}/var/docker-distribution/log \
$RPM_BUILD_ROOT%{l_prefix}/var/docker-distribution/db
$RPM_BUILD_ROOT%{l_prefix}/var/docker-distribution/data
# install program
%{l_shtool} install -c -s -m 755 \
@ -91,14 +93,23 @@ PreReq: OpenPKG, openpkg >= 20140101
src/github.com/docker/distribution/bin/registry \
$RPM_BUILD_ROOT%{l_prefix}/sbin/docker-registry
# install password utility
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE docker-passwd.sh} \
$RPM_BUILD_ROOT%{l_prefix}/sbin/docker-passwd
# install run-command script
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.docker-distribution} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# install default configuration
%{l_shtool} install -c -m 644 %{l_value -s -a} \
-e "s;@secret@;`apg -n1 -a1 -m64 -x64 -M NCL`;" \
%{SOURCE docker-registry.yml} \
$RPM_BUILD_ROOT%{l_prefix}/etc/docker-distribution/
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE docker-registry.pwd} \
$RPM_BUILD_ROOT%{l_prefix}/etc/docker-distribution/
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
@ -112,9 +123,17 @@ PreReq: OpenPKG, openpkg >= 20140101
%post
# after upgrade, restart service
[ $1 -eq 2 ] || exit 0
if [ $1 -eq 1 ]; then
( echo "You can access your Docker Registry under the URL:"
echo " http://127.0.0.1:5001/"
echo "A default user 'docker' with password 'docker' was pre-configured."
echo "Set a new password with:"
echo " \$ $RPM_INSTALL_PREFIX/sbin/docker-passwd docker <password>"
) | %{l_rpmtool} msg -b -t notice
elif [ $1 -eq 2 ]; then
eval `%{l_rc} docker-distribution status 2>/dev/null`
[ ".$docker_distribution_active" = .yes ] && %{l_rc} docker-distribution restart
fi
exit 0
%preun
@ -123,6 +142,6 @@ PreReq: OpenPKG, openpkg >= 20140101
%{l_rc} docker-distribution stop 2>/dev/null
rm -rf $RPM_INSTALL_PREFIX/var/docker-distribution/log/* >/dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/var/docker-distribution/run/* >/dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/var/docker-distribution/db/* >/dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/var/docker-distribution/data/* >/dev/null 2>&1 || true
exit 0

1
docker-distribution/docker-registry.pwd

@ -0,0 +1 @@
docker:A0KeZa6S13eek

63
docker-distribution/docker-registry.yml

@ -3,8 +3,10 @@
##
version: 0.1
log:
level: debug
level: info
formatter: text
fields:
service: registry
environment: development
@ -22,42 +24,33 @@ log:
from: docker-registry@example.com
to:
- postmaster@example.com
http:
addr: 127.0.0.1:5000
net: tcp
prefix: /
secret: @secret@
tls:
certificate: @l_prefix@/etc/x509/example-server.crt.pem
key: @l_prefix@/etc/x509/example-server.key.pem
clientcas:
- @l_prefix@/etc/x509/example-ca.crt.pem
- @l_prefix@/etc/x509/public-ca.crt.pem
auth:
htpasswd:
realm: basic-realm
path: @l_prefix@/etc/docker-distribution/docker-registry.pwd
storage:
cache:
blobdescriptor: redis
filesystem:
rootdirectory: @l_prefix@/var/docker-distribution/db
rootdirectory: @l_prefix@/var/docker-distribution/data
cache:
blobdescriptor: inmemory
maintenance:
uploadpurging:
enabled: false
http:
addr: 127.0.0.1:5000
secret: asecretforlocaldevelopment
debug:
addr: 127.0.0.1:5001
redis:
addr: localhost:6379
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
notifications:
endpoints:
- name: local-8082
url: http://localhost:5003/callback
headers:
Authorization: [Bearer <an example token>]
timeout: 1s
threshold: 10
backoff: 1s
disabled: true
- name: local-8083
url: http://localhost:8083/callback
timeout: 1s
threshold: 10
backoff: 1s
disabled: true
enabled: true
age: 168h
interval: 24h
dryrun: false

8
docker-distribution/rc.docker-distribution

@ -13,9 +13,9 @@
docker_distribution_log_complevel="9"
%common
docker_distribution_cfgfile="@l_prefix@/etc/docker_distribution/docker-registry.yml"
docker_distribution_pidfile="@l_prefix@/var/docker_distribution/run/docker-registry.pid"
docker_distribution_logfile="@l_prefix@/var/docker_distribution/log/docker-registry.log"
docker_distribution_cfgfile="@l_prefix@/etc/docker-distribution/docker-registry.yml"
docker_distribution_pidfile="@l_prefix@/var/docker-distribution/run/docker-registry.pid"
docker_distribution_logfile="@l_prefix@/var/docker-distribution/log/docker-registry.log"
docker_distribution_signal () {
[ -f $docker_distribution_pidfile ] && kill -$1 `cat $docker_distribution_pidfile`
}
@ -34,7 +34,7 @@
rcService docker-distribution active yes && exit 0
( nohup @l_prefix@/sbin/docker-registry \
$docker_distribution_flags \
$docker_distribution_cfgfile
$docker_distribution_cfgfile \
</dev/null >>$docker_distribution_logfile 2>&1 &
echo $! >$docker_distribution_pidfile
) >/dev/null 2>&1

Loading…
Cancel
Save