vagrant-docker-mirror-config 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/vagrant-docker-mirror-config/docker_mirror_config.rb +15 -12
- data/lib/vagrant-docker-mirror-config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb9676f204982f48a8ab97b94d7f1d894511a37e
|
4
|
+
data.tar.gz: 0e007f58482d2f0f0cca433ee39cb250ae1eb619
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef68793aa622a1eaf5532faed2c20857aab7c0d84aa8e678af9556489a5cde0dc1f958ba0c607ec7febb3c5f61f7ff6ea2bd6f365b6cfb5400620cf551d4e6e2
|
7
|
+
data.tar.gz: 5163a581ba02be45c2e7bb6c0354147ea119e5800455c835baf71a8582a65d3c5acb4b93957f111148ee460fd1444616996e901f70254d580efd4ab5a5db202d
|
data/Gemfile
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require "pathname"
|
2
|
+
require "json"
|
3
|
+
require "vagrant/util/downloader"
|
2
4
|
|
3
5
|
module VagrantPlugins
|
4
6
|
module DockerMirrorConfigProvisioner
|
@@ -10,18 +12,19 @@ module VagrantPlugins
|
|
10
12
|
|
11
13
|
def configure
|
12
14
|
@machine.communicate.tap do |comm|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
comm.
|
15
|
+
if comm.test("cat /etc/docker/daemon.json 2>&1")
|
16
|
+
json = comm.sudo("cat /etc/docker/daemon.json 2>&1")
|
17
|
+
json = json.parse(json)
|
18
|
+
else
|
19
|
+
json = {}
|
20
|
+
end
|
21
|
+
json["registry-mirrors"] = [] if not json['registry-mirrors']
|
22
|
+
json["registry-mirrors"].insert(0, "#{@config.scheme}://#{@config.host}:#{@config.port}")
|
23
|
+
json["insecure-registries"] = [] if not json['insecure-registries'] && @config.insecure
|
24
|
+
json["insecure-registries"].insert(0, "#{@config.host}:#{@config.port}") if @config.insecure
|
25
|
+
File.open("/tmp/daemon.json", 'w') { |file| file.write(JSON.pretty_generate(json)) }
|
26
|
+
comm.upload("/tmp/daemon.json", "/tmp/daemon.json")
|
27
|
+
comm.sudo("mv /tmp/daemon.json /etc/docker/daemon.json")
|
25
28
|
comm.sudo("systemctl daemon-reload")
|
26
29
|
comm.sudo("systemctl restart docker")
|
27
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-docker-mirror-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoffrey Ragot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Vagrant provisioner for configuring mirror for docker.
|
14
14
|
email:
|