diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-emulation/docker-registry | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-emulation/docker-registry')
8 files changed, 165 insertions, 0 deletions
diff --git a/app-emulation/docker-registry/Manifest b/app-emulation/docker-registry/Manifest new file mode 100644 index 000000000000..520df8bc4a14 --- /dev/null +++ b/app-emulation/docker-registry/Manifest @@ -0,0 +1,8 @@ +AUX docker-registry-2.6.1-notifications-expvar.patch 2360 BLAKE2B 15cf7bbc25503c6af51552ec18a8d585a5ae4e2b79ed385da01da568e79e5f68e6fbd4dfbbd5ed8a40ffc86a337b44fd78457658d28f57f76b081a4509c6ff6a SHA512 2a1aa8fd0f5df6380c8b0b11bdbc0c8f62c02cdbd87d1b697f691189c04409c71a69cf50e36704cb8b7c3c6040c88c77110076aae439aa9e173f95b4347dbc0a +AUX registry.confd 85 BLAKE2B 0997c1ad7ee8fc165a87cfebeea75694487c8d8b62130fb19fd4d9c55cc605754537deaea6e114a9fb28e46eb67bb6ab9d01de0971163acf22f223ca8ec84605 SHA512 7cbd19f545b659e2d295938b320710ae20b3c2222fcb6668216985c6e55bf51647041dec1c33ab7271e464f13001d8095fef9240d3390cff7e65028d3432c4f4 +AUX registry.initd 606 BLAKE2B ed8af2651d91be13578edb561c067cfd3e72dfe42a6111be8930d61f233248b7364659a8db5a9800eaa167d76a8b2daf9d121970622de235e61fa0f10ad85174 SHA512 af7780264d068adcd0d6a6768b88ab43c26081b71d1ebd591ca6d175e413cdeee935a6f50d9833775690f0b47daadcc33286f86fb5eb98d2e674b225122aabce +AUX registry.logrotated 89 BLAKE2B c16fab4c6a3c4fd9f48370ae30505408a49e07c2a7ea7fc119717efcd840ad489c92855e27a5546219b3cdeb257642eb65abc2d544859295688925ae2e94ecb3 SHA512 f824b33a1fa38802a8aa79599843b0ea065603799823352e9515c50bfc61c43a03e9eb5327f9c687b8c3864fc633ad1a46bff9e91f4c54a46a09e67d2f6f833b +AUX registry.service 323 BLAKE2B 1be481d08a283793d10ef870fc299e1c284087878e67ec54f44e662c616127bc411fdde19659cf7acd69787054c624c5c5206434c36b4e5a0fcceaf79c2e78f0 SHA512 67d2b69c1fc497774e3171628fa73b9b9521e19c76414e32721994f2ba614bd3c6896c578c9d9b8af0ad4972b9da0c504ef787a7585a550be4bfe1bd40eafc15 +DIST docker-registry-2.6.2.tar.gz 1579760 BLAKE2B d0e067f2e9124847b5e362f23ca7d67655fbf0a6227efc3fd9073d5360389d6d8531e5709b52225c54e6e3097a2d5d79102e27fd09412b95d2e5d8a4a30dde2d SHA512 a091db2e15d7c1dc8cd39a40de5bb63cc1ead68e95dfaf6b3735a789adb87f146c03eff81f700e0059e5f6ffc43e6c3dd3358503697882cb080b991629f82c60 +EBUILD docker-registry-2.6.2-r1.ebuild 1199 BLAKE2B dfe3762a2b4e593b653fd2a8ef2eda0b1988163daff5551280c34f8e078a69c802d615be55ae257bcdc24cc9ac76e32317133cd6bc83d3f536b206332b7bd073 SHA512 1405e36c07065c0d6c75fc59548b64f5bc9e69726324e5e6f552be1790cdcf4057a78f6d770e3e1144c36b2edc1e483c1e455550785e263474942b676ac6f643 +MISC metadata.xml 310 BLAKE2B b7a4e4e347c4b262857668fb0bba20e1efce6abc449cf3614538b34f03c897ce78e637db513a66e8e5ff9b1262df44d864aa41904ef7e86eee384bdafbb014cb SHA512 bcf043907e7e2ad9ef21a4b02b4aeb0f50bd17b1e5315653b2339036d4775bde661d711d4e84536f657c7bf9247ef446f1c95abdf14699620e44a104c9e1fe0a diff --git a/app-emulation/docker-registry/docker-registry-2.6.2-r1.ebuild b/app-emulation/docker-registry/docker-registry-2.6.2-r1.ebuild new file mode 100644 index 000000000000..6ea2a86bd59b --- /dev/null +++ b/app-emulation/docker-registry/docker-registry-2.6.2-r1.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit golang-vcs-snapshot systemd user + +KEYWORDS="~amd64" +EGO_PN="github.com/docker/distribution" +EGIT_COMMIT="v${PV}" +SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +DESCRIPTION="Docker Registry 2.0" +HOMEPAGE="https://github.com/docker/distribution" +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" +SVCNAME=registry + +PATCHES=( "${FILESDIR}/${PN}-2.6.1-notifications-expvar.patch" ) + +pkg_setup() { + enewgroup ${SVCNAME} + enewuser ${SVCNAME} -1 -1 /dev/null ${SVCNAME} +} + +src_compile() { + GOPATH="${S}" \ + go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}/..." || die +} + +src_install() { + exeinto /usr/libexec/${PN} + doexe bin/* + insinto /etc/docker/registry + newins src/${EGO_PN}/cmd/registry/config-example.yml config.yml.example + newinitd "${FILESDIR}/${SVCNAME}.initd" "${SVCNAME}" + newconfd "${FILESDIR}/${SVCNAME}.confd" "${SVCNAME}" + systemd_dounit "${FILESDIR}/${SVCNAME}.service" + keepdir /var/{lib,log}/${SVCNAME} + fowners ${SVCNAME}:${SVCNAME} /var/{lib,log}/${SVCNAME} + insinto /etc/logrotate.d + newins "${FILESDIR}/${SVCNAME}.logrotated" "${SVCNAME}" +} diff --git a/app-emulation/docker-registry/files/docker-registry-2.6.1-notifications-expvar.patch b/app-emulation/docker-registry/files/docker-registry-2.6.1-notifications-expvar.patch new file mode 100644 index 000000000000..1d40edf1f0cd --- /dev/null +++ b/app-emulation/docker-registry/files/docker-registry-2.6.1-notifications-expvar.patch @@ -0,0 +1,64 @@ +From 9a58c91051e03b46f1461e371a7bf527c1284612 Mon Sep 17 00:00:00 2001 +From: Noah Treuhaft <noah.treuhaft@docker.com> +Date: Wed, 8 Feb 2017 11:38:44 -0800 +Subject: [PATCH] notifications: fix expvar for Go 1.7 + +Remove EndpointConfig.Transport from the return value of the +registry.notifications.endpoints expvar.Func. It results in an empty +value for that expvar variable under Go 1.7 because it is a non-nil +*http.Transport, which Go 1.7 can no longer encode as JSON. + +Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com> +--- + notifications/endpoint.go | 2 +- + notifications/metrics_test.go | 28 ++++++++++++++++++++++++++++ + 2 files changed, 29 insertions(+), 1 deletion(-) + create mode 100644 notifications/metrics_test.go + +diff --git a/src/github.com/docker/distribution/notifications/endpoint.go b/src/github.com/docker/distribution/notifications/endpoint.go +index 29a9e27b5..44d0f6d7b 100644 +--- a/src/github.com/docker/distribution/notifications/endpoint.go ++++ b/src/github.com/docker/distribution/notifications/endpoint.go +@@ -13,7 +13,7 @@ type EndpointConfig struct { + Threshold int + Backoff time.Duration + IgnoredMediaTypes []string +- Transport *http.Transport ++ Transport *http.Transport `json:"-"` + } + + // defaults set any zero-valued fields to a reasonable default. +diff --git a/src/github.com/docker/distribution/notifications/metrics_test.go b/src/github.com/docker/distribution/notifications/metrics_test.go +new file mode 100644 +index 000000000..03a08e2c8 +--- /dev/null ++++ b/notifications/metrics_test.go +@@ -0,0 +1,28 @@ ++package notifications ++ ++import ( ++ "encoding/json" ++ "expvar" ++ "testing" ++) ++ ++func TestMetricsExpvar(t *testing.T) { ++ endpointsVar := expvar.Get("registry").(*expvar.Map).Get("notifications").(*expvar.Map).Get("endpoints") ++ ++ var v interface{} ++ if err := json.Unmarshal([]byte(endpointsVar.String()), &v); err != nil { ++ t.Fatalf("unexpected error unmarshaling endpoints: %v", err) ++ } ++ if v != nil { ++ t.Fatalf("expected nil, got %#v", v) ++ } ++ ++ NewEndpoint("x", "y", EndpointConfig{}) ++ ++ if err := json.Unmarshal([]byte(endpointsVar.String()), &v); err != nil { ++ t.Fatalf("unexpected error unmarshaling endpoints: %v", err) ++ } ++ if slice, ok := v.([]interface{}); !ok || len(slice) != 1 { ++ t.Logf("expected one-element []interface{}, got %#v", v) ++ } ++} diff --git a/app-emulation/docker-registry/files/registry.confd b/app-emulation/docker-registry/files/registry.confd new file mode 100644 index 000000000000..bfa97f127ef1 --- /dev/null +++ b/app-emulation/docker-registry/files/registry.confd @@ -0,0 +1,2 @@ +# arguments for docker-registry +command_args="serve /etc/docker/registry/config.yml" diff --git a/app-emulation/docker-registry/files/registry.initd b/app-emulation/docker-registry/files/registry.initd new file mode 100644 index 000000000000..b81303c624d1 --- /dev/null +++ b/app-emulation/docker-registry/files/registry.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 2016-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Docker Registry 2.0" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/libexec/docker-${RC_SVCNAME}/${RC_SVCNAME}" +command_args="${command_args:-serve /etc/docker/registry/config.yml}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \ + --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log" + +depend() { + need net +} diff --git a/app-emulation/docker-registry/files/registry.logrotated b/app-emulation/docker-registry/files/registry.logrotated new file mode 100644 index 000000000000..3cb63f949a08 --- /dev/null +++ b/app-emulation/docker-registry/files/registry.logrotated @@ -0,0 +1,7 @@ +/var/log/registry/registry.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-emulation/docker-registry/files/registry.service b/app-emulation/docker-registry/files/registry.service new file mode 100644 index 000000000000..14ff5f9c0b77 --- /dev/null +++ b/app-emulation/docker-registry/files/registry.service @@ -0,0 +1,13 @@ +[Unit] +Description=Docker Registry 2.0 +Requires=network-online.target +After=network-online.target + +[Service] +User=registry +PrivateDevices=Yes +Environment="DOCKER_REGISTRY_ARGS=serve /etc/docker/registry/config.yml" +ExecStart=/usr/libexec/docker-registry/registry $DOCKER_REGISTRY_ARGS + +[Install] +WantedBy=multi-user.target diff --git a/app-emulation/docker-registry/metadata.xml b/app-emulation/docker-registry/metadata.xml new file mode 100644 index 000000000000..4f66ba32a890 --- /dev/null +++ b/app-emulation/docker-registry/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zmedico@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="github">docker/distribution</remote-id> + </upstream> +</pkgmetadata> |