|
|
|
@ -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,17 +123,25 @@ PreReq: OpenPKG, openpkg >= 20140101
|
|
|
|
|
|
|
|
|
|
%post |
|
|
|
|
# after upgrade, restart service |
|
|
|
|
[ $1 -eq 2 ] || exit 0 |
|
|
|
|
eval `%{l_rc} docker-distribution status 2>/dev/null` |
|
|
|
|
[ ".$docker_distribution_active" = .yes ] && %{l_rc} docker-distribution restart |
|
|
|
|
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 |
|
|
|
|
# before erase, stop service and remove log files |
|
|
|
|
[ $1 -eq 0 ] || exit 0 |
|
|
|
|
%{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/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/data/* >/dev/null 2>&1 || true |
|
|
|
|
exit 0 |
|
|
|
|
|
|
|
|
|