summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2017-02-27 15:25:39 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-02-27 15:25:39 -0500
commitc5cd21af5f27309c7926b781852e1ef22940a10d (patch)
treeb97f135b0b40d1c9f8bfdfc13b89e1c348d01953 /recipes-containers/docker
parentc85b181e7e907793008f58ca20ae49ec68d2c4b5 (diff)
downloadmeta-virtualization-c5cd21af5f27309c7926b781852e1ef22940a10d.tar.gz
docker: remove obsolete docker-registry recipe
The docker v1 registry has long been depreciated and moved into the docker distribution library. The registry is run via the docker CLI and not through a standalone server. This change removes the old registry and adds a .service file + package for docker registry in the main docker recipe. Anyone that wants to run a local registry can install the docker-registry package and the service will start. Note: No full config.yml file is provided, since the default are sane. If tweaks are required, we can use ENV vars or consider adding a config overlay. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/docker')
-rw-r--r--recipes-containers/docker/docker_git.bb12
-rw-r--r--recipes-containers/docker/files/docker-registry.service19
2 files changed, 30 insertions, 1 deletions
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index da1aef6a..bad3d866 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -24,6 +24,7 @@ SRC_URI = "\
24 git://github.com/docker/docker.git;nobranch=1;name=docker \ 24 git://github.com/docker/docker.git;nobranch=1;name=docker \
25 git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=libnetwork \ 25 git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=libnetwork \
26 file://docker.init \ 26 file://docker.init \
27 file://docker-registry.service \
27 file://hi.Dockerfile \ 28 file://hi.Dockerfile \
28 file://context-use-golang.org-x-net-pkg-until-we-move-to-go.patch \ 29 file://context-use-golang.org-x-net-pkg-until-we-move-to-go.patch \
29 " 30 "
@@ -59,7 +60,7 @@ DEPENDS = " \
59 grpc-go \ 60 grpc-go \
60 " 61 "
61 62
62PACKAGES =+ "${PN}-contrib" 63PACKAGES =+ "${PN}-contrib ${PN}-registry"
63 64
64DEPENDS_append_class-target = "lvm2" 65DEPENDS_append_class-target = "lvm2"
65RDEPENDS_${PN} = "curl aufs-util git util-linux iptables \ 66RDEPENDS_${PN} = "curl aufs-util git util-linux iptables \
@@ -135,6 +136,10 @@ inherit systemd update-rc.d
135 136
136SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" 137SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
137SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" 138SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
139SYSTEMD_SERVICE_${PN}-registry = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker-registry.service','',d)}"
140
141SYSTEMD_AUTO_ENABLE_${PN}-registry = "enable"
142SYSTEMD_AUTO_ENABLE_${PN} = "enable"
138 143
139INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" 144INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
140INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" 145INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
@@ -151,6 +156,8 @@ do_install() {
151 install -m 644 ${S}/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system 156 install -m 644 ${S}/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system
152 # replaces one copied from above with one that uses the local registry for a mirror 157 # replaces one copied from above with one that uses the local registry for a mirror
153 install -m 644 ${S}/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system 158 install -m 644 ${S}/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system
159
160 install -m 644 ${WORKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system
154 else 161 else
155 install -d ${D}${sysconfdir}/init.d 162 install -d ${D}${sysconfdir}/init.d
156 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init 163 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
@@ -165,6 +172,9 @@ inherit useradd
165USERADD_PACKAGES = "${PN}" 172USERADD_PACKAGES = "${PN}"
166GROUPADD_PARAM_${PN} = "-r docker" 173GROUPADD_PARAM_${PN} = "-r docker"
167 174
175FILES_${PN}-registry += "${systemd_unitdir}/system/docker-registry.service"
176RDEPENDS_${PN}-registry += "docker"
177
168FILES_${PN} += "${systemd_unitdir}/system/*" 178FILES_${PN} += "${systemd_unitdir}/system/*"
169 179
170FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" 180FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
diff --git a/recipes-containers/docker/files/docker-registry.service b/recipes-containers/docker/files/docker-registry.service
new file mode 100644
index 00000000..7b4bc468
--- /dev/null
+++ b/recipes-containers/docker/files/docker-registry.service
@@ -0,0 +1,19 @@
1[Unit]
2Description=docker private registry service
3After=docker.service
4
5[Service]
6ExecStartPre=-/usr/bin/docker kill registry
7ExecStartPre=-/usr/bin/docker rm registry
8ExecStart=/usr/bin/docker run --name registry -v /mirror/registry:/tmp/ -p 5000:5000 \
9 -e "STANDALONE=true" \
10 -e "MIRROR_SOURCE=https://registry-1.docker.io" \
11 -e "MIRROR_SOURCE_INDEX=https://index.docker.io" \
12 -e "SETTINGS_FLAVOR=local" \
13 registry
14ExecStop=-/usr/bin/docker stop registry
15Restart=always
16RestartSec=10s
17
18[Install]
19WantedBy=multi-user.target