vagrant-docker_load 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +116 -0
- data/LICENSE.txt +21 -0
- data/README.md +11 -0
- data/Rakefile +3 -0
- data/lib/vagrant/docker_load.rb +14 -0
- data/lib/vagrant/docker_load/command.rb +71 -0
- data/lib/vagrant/docker_load/version.rb +5 -0
- data/vagrant-docker_load.gemspec +19 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9027b09c01f390885f7d8677fe4d40a245c424a200cf6122af0d932fc1da21d7
|
4
|
+
data.tar.gz: 49f4039d3fa742b9fb68d1b720b6e6b8a9c66e1d423c2979fe7768cdf7bff5fe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d0ea260e269697f2fe71aa41800be5b8b0365e44c6ccce417120645bc9a2a320e1e2ae3fc19e973fdd6a79957df7472f68159fcc89c9c38f2d49e33b6facd7ff
|
7
|
+
data.tar.gz: 7df1044e78e4ace8a5d987bc9017959bfb07a26aaf73857f4496606c0a4e993dc3c49241d41214bfbf03b4f380bae836582e909f79f6ac92027954c023d13a51
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/hashicorp/vagrant.git
|
3
|
+
revision: 1220122b46b4cfbca24a48a45f2cefb7cf088ce1
|
4
|
+
specs:
|
5
|
+
vagrant (2.2.5.dev)
|
6
|
+
bcrypt_pbkdf (~> 1.0.0)
|
7
|
+
childprocess (~> 0.6.0)
|
8
|
+
ed25519 (~> 1.2.4)
|
9
|
+
erubis (~> 2.7.0)
|
10
|
+
hashicorp-checkpoint (~> 0.1.5)
|
11
|
+
i18n (~> 1.1.1)
|
12
|
+
listen (~> 3.1.5)
|
13
|
+
log4r (~> 1.1.9, < 1.1.11)
|
14
|
+
net-scp (~> 1.2.0)
|
15
|
+
net-sftp (~> 2.1)
|
16
|
+
net-ssh (~> 5.1.0)
|
17
|
+
rb-kqueue (~> 0.2.0)
|
18
|
+
rest-client (>= 1.6.0, < 3.0)
|
19
|
+
ruby_dep (<= 1.3.1)
|
20
|
+
rubyzip (~> 1.2.2)
|
21
|
+
vagrant_cloud (~> 2.0.2)
|
22
|
+
wdm (~> 0.1.0)
|
23
|
+
winrm (~> 2.1)
|
24
|
+
winrm-elevated (~> 1.1)
|
25
|
+
winrm-fs (~> 1.0)
|
26
|
+
|
27
|
+
PATH
|
28
|
+
remote: .
|
29
|
+
specs:
|
30
|
+
vagrant-docker_load (0.1.0)
|
31
|
+
|
32
|
+
GEM
|
33
|
+
remote: https://rubygems.org/
|
34
|
+
specs:
|
35
|
+
bcrypt_pbkdf (1.0.0)
|
36
|
+
builder (3.2.3)
|
37
|
+
childprocess (0.6.3)
|
38
|
+
ffi (~> 1.0, >= 1.0.11)
|
39
|
+
concurrent-ruby (1.1.5)
|
40
|
+
domain_name (0.5.20180417)
|
41
|
+
unf (>= 0.0.5, < 1.0.0)
|
42
|
+
ed25519 (1.2.4)
|
43
|
+
erubis (2.7.0)
|
44
|
+
ffi (1.10.0)
|
45
|
+
gssapi (1.2.0)
|
46
|
+
ffi (>= 1.0.1)
|
47
|
+
gyoku (1.3.1)
|
48
|
+
builder (>= 2.1.2)
|
49
|
+
hashicorp-checkpoint (0.1.5)
|
50
|
+
http-cookie (1.0.3)
|
51
|
+
domain_name (~> 0.5)
|
52
|
+
httpclient (2.8.3)
|
53
|
+
i18n (1.1.1)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
listen (3.1.5)
|
56
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
57
|
+
little-plugger (1.1.4)
|
58
|
+
log4r (1.1.10)
|
59
|
+
logging (2.2.2)
|
60
|
+
little-plugger (~> 1.1)
|
61
|
+
multi_json (~> 1.10)
|
62
|
+
mime-types (3.2.2)
|
63
|
+
mime-types-data (~> 3.2015)
|
64
|
+
mime-types-data (3.2018.0812)
|
65
|
+
multi_json (1.13.1)
|
66
|
+
net-scp (1.2.1)
|
67
|
+
net-ssh (>= 2.6.5)
|
68
|
+
net-sftp (2.1.2)
|
69
|
+
net-ssh (>= 2.6.5)
|
70
|
+
net-ssh (5.1.0)
|
71
|
+
netrc (0.11.0)
|
72
|
+
nori (2.6.0)
|
73
|
+
rb-inotify (0.10.0)
|
74
|
+
ffi (~> 1.0)
|
75
|
+
rb-kqueue (0.2.5)
|
76
|
+
ffi (>= 0.5.0)
|
77
|
+
rest-client (2.0.2)
|
78
|
+
http-cookie (>= 1.0.2, < 2.0)
|
79
|
+
mime-types (>= 1.16, < 4.0)
|
80
|
+
netrc (~> 0.8)
|
81
|
+
ruby_dep (1.3.1)
|
82
|
+
rubyntlm (0.6.2)
|
83
|
+
rubyzip (1.2.2)
|
84
|
+
unf (0.1.4)
|
85
|
+
unf_ext
|
86
|
+
unf_ext (0.0.7.5)
|
87
|
+
vagrant_cloud (2.0.2)
|
88
|
+
rest-client (~> 2.0.2)
|
89
|
+
wdm (0.1.1)
|
90
|
+
winrm (2.3.1)
|
91
|
+
builder (>= 2.1.2)
|
92
|
+
erubis (~> 2.7)
|
93
|
+
gssapi (~> 1.2)
|
94
|
+
gyoku (~> 1.0)
|
95
|
+
httpclient (~> 2.2, >= 2.2.0.2)
|
96
|
+
logging (>= 1.6.1, < 3.0)
|
97
|
+
nori (~> 2.0)
|
98
|
+
rubyntlm (~> 0.6.0, >= 0.6.1)
|
99
|
+
winrm-elevated (1.1.1)
|
100
|
+
winrm (~> 2.0)
|
101
|
+
winrm-fs (~> 1.0)
|
102
|
+
winrm-fs (1.3.2)
|
103
|
+
erubis (~> 2.7)
|
104
|
+
logging (>= 1.6.1, < 3.0)
|
105
|
+
rubyzip (~> 1.1)
|
106
|
+
winrm (~> 2.0)
|
107
|
+
|
108
|
+
PLATFORMS
|
109
|
+
ruby
|
110
|
+
|
111
|
+
DEPENDENCIES
|
112
|
+
vagrant!
|
113
|
+
vagrant-docker_load!
|
114
|
+
|
115
|
+
BUNDLED WITH
|
116
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Noah Watkins
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require "vagrant/docker_load/version"
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
module DockerLoad
|
5
|
+
class Plugin < Vagrant.plugin("2")
|
6
|
+
name "Vagrant Docker image loader"
|
7
|
+
|
8
|
+
command "docker-load" do
|
9
|
+
require_relative "docker_load/command"
|
10
|
+
Command
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require "tempfile"
|
2
|
+
require "open3"
|
3
|
+
|
4
|
+
module Vagrant
|
5
|
+
module DockerLoad
|
6
|
+
class Command < Vagrant.plugin(2, :command)
|
7
|
+
def self.synopsis
|
8
|
+
"loads a host docker image into vagrant machines"
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute
|
12
|
+
opts = OptionParser.new do |o|
|
13
|
+
o.banner = "Usage: vagrant docker-load src-img dst-img"
|
14
|
+
o.separator ""
|
15
|
+
end
|
16
|
+
|
17
|
+
src_img, dst_img = parse_options(opts)
|
18
|
+
return if dst_img.nil?
|
19
|
+
|
20
|
+
src = Tempfile.new("vagrant-docker_load")
|
21
|
+
|
22
|
+
run("docker save -o #{src.path} #{src_img}")
|
23
|
+
|
24
|
+
with_target_vms(nil) do |machine|
|
25
|
+
ssh_info = machine.ssh_info
|
26
|
+
raise Vagrant::Errors::SSHNotReady if ssh_info.nil?
|
27
|
+
|
28
|
+
log_level = ssh_info[:log_level] || "FATAL"
|
29
|
+
|
30
|
+
args = [
|
31
|
+
"-p", ssh_info[:port].to_s,
|
32
|
+
"-o", "LogLevel=#{log_level}"]
|
33
|
+
|
34
|
+
if ssh_info[:verify_host_key] == :never || !ssh_info[:verify_host_key]
|
35
|
+
args += [
|
36
|
+
"-o", "StrictHostKeyChecking=no",
|
37
|
+
"-o", "UserKnownHostsFile=/dev/null"]
|
38
|
+
end
|
39
|
+
|
40
|
+
if ssh_info[:proxy_command]
|
41
|
+
args += ["-o", "ProxyCommand=#{ssh_info[:proxy_command]}"]
|
42
|
+
end
|
43
|
+
|
44
|
+
if ssh_info[:private_key_path]
|
45
|
+
ssh_info[:private_key_path].each do |path|
|
46
|
+
args += ["-i", path]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
args += ["#{ssh_info[:username]}@#{ssh_info[:host]}"]
|
51
|
+
|
52
|
+
ssh_command = ["ssh", args]
|
53
|
+
|
54
|
+
load_command = ssh_command + ["sudo", "docker", "load"]
|
55
|
+
Open3.pipeline(load_command.join(" "), :in => src.path)
|
56
|
+
|
57
|
+
tag_command = ssh_command + ["sudo", "docker", "tag", src_img, dst_img]
|
58
|
+
system(tag_command.join(" "))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def run(command)
|
63
|
+
stdout, stderr, status = Open3.capture3(command)
|
64
|
+
unless status.success?
|
65
|
+
@env.ui.error(stderr)
|
66
|
+
raise Vagrant::Errors::SSHNotReady
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "vagrant/docker_load/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "vagrant-docker_load"
|
7
|
+
spec.version = Vagrant::DockerLoad::VERSION
|
8
|
+
spec.authors = ["Noah Watkins"]
|
9
|
+
spec.email = ["noahwatkins@gmail.com"]
|
10
|
+
spec.summary = "Load Docker images into Vagrant machines"
|
11
|
+
spec.homepage = "https://github.com/noahdesu/vagrant-docker_load"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
14
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
15
|
+
end
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
18
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-docker_load
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Noah Watkins
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- noahwatkins@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- Gemfile.lock
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- lib/vagrant/docker_load.rb
|
55
|
+
- lib/vagrant/docker_load/command.rb
|
56
|
+
- lib/vagrant/docker_load/version.rb
|
57
|
+
- vagrant-docker_load.gemspec
|
58
|
+
homepage: https://github.com/noahdesu/vagrant-docker_load
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.7.6
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Load Docker images into Vagrant machines
|
82
|
+
test_files: []
|