-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoreos-userdata
60 lines (53 loc) · 1.85 KB
/
coreos-userdata
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#cloud-config
coreos:
etcd:
discovery: http://172.17.8.100:4001/v2/keys/testcluster
name: docker-registry-service
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
units:
- name: etcd.service
command: start
- name: docker-tcp.socket
command: start
enable: true
content: |
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=4243
Service=docker.service
BindIPv6Only=both
[Install]
WantedBy=sockets.target
- name: docker-registry-service.service
command: start
runtime: no
enable: true
content: |
[Unit]
Description=Docker Registry Service
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=/bin/bash -c 'if [ ! -d "/var/lib/docker-registry-service" ]; then git clone -b master --single-branch --depth 1 https://github.com/INAETICS/docker-registry-service.git /var/lib/docker-registry-service; else cd /var/lib/docker-registry-service; git pull; cd -; fi'
ExecStartPre=/var/lib/docker-registry-service/docker-registry-service build
ExecStart=/var/lib/docker-registry-service/docker-registry-service run
TimeoutSec=600
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
- name: docker-registry-announce.service
command: start
runtime: no
enable: true
content: |
[Unit]
Description=Docker Registry Announce
BindsTo=docker-registry-service.service
[Service]
ExecStart=/bin/sh -c "while true; do etcdctl set /inaetics/docker-registry-service/%m $public_ipv4:5000 --ttl 60; sleep 45; done"
ExecStopPost=/usr/bin/etcdctl rm /inaetics/docker-registry-service/%m
[Install]
WantedBy=multi-user.target