lux 0.7 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -0
- data/lib/lux/version.rb +1 -1
- data/lib/lux.rb +6 -3
- data/lux.gemspec +2 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a59ca3dfc3b9dc7b392ba2eccb2e03fdf762a345
|
4
|
+
data.tar.gz: e64035da3da05c6d9ff4aafbe48d909e3bd09164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3da8015452b5ed70a742a1a69951c625d632846d14b6c9ac9156f7fa19e09d0490bd0bbde71e9230fca3ceef806add3283768d0c951792e99cdb00246ee9355f
|
7
|
+
data.tar.gz: 0894977bcfef8ef4e769805cb1167358352b406ce3930b98389cd11dbfa2cd10b9a93d5b0b5a591f7e9e10f9b57d95a0f24a7f4df4ae83d90abd1005c5a07348
|
data/Rakefile
CHANGED
data/lib/lux/version.rb
CHANGED
data/lib/lux.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
2
|
-
|
1
|
+
require 'lux/version'
|
2
|
+
|
3
3
|
require 'highline/import'
|
4
|
+
require 'pathname'
|
4
5
|
require 'shellwords'
|
5
6
|
require 'thor'
|
6
7
|
require 'uri'
|
@@ -56,6 +57,7 @@ class Lux::App < Thor
|
|
56
57
|
desc "start IMAGE", "Run a Docker image with user/home mapping"
|
57
58
|
method_option :env, type: :string, aliases: '-e', desc: 'Path to environment file'
|
58
59
|
method_option :name, type: :string, aliases: '-n', default: '<autogenerated>', desc: 'Docker container name'
|
60
|
+
method_option :port, type: :string, aliases: '-p', default: nil, desc: 'Expose ports (default all)'
|
59
61
|
def start(image)
|
60
62
|
image = findimage image
|
61
63
|
raise "no image" if image.empty?
|
@@ -64,6 +66,7 @@ class Lux::App < Thor
|
|
64
66
|
args = ["-v #{ENV['HOME']}:#{ENV['HOME']}"]
|
65
67
|
args << "--env-file=#{options.env}" if options.env
|
66
68
|
args << "--name=#{options.name}" unless options.name == '<autogenerated>'
|
69
|
+
args << (options.port ? "-p #{options.port}" : "-P")
|
67
70
|
cid = `docker run -dit #{args.join(' ')} #{image} /bin/bash`.strip
|
68
71
|
die "Container failed to start" unless cid =~ /^[a-z0-9]+$/
|
69
72
|
system "docker exec #{cid} bash -c #{setup_cmd.shellescape}"
|
@@ -154,7 +157,7 @@ class Lux::App < Thor
|
|
154
157
|
imageage = imageinfo[3..-3].join(' ')
|
155
158
|
next unless matcher.call(imagename)
|
156
159
|
if options.force or (agree("Delete #{imagename} (#{imageage}, #{imagesize})? "){|q|q.echo=true})
|
157
|
-
`docker rmi #{imageinfo[2]}`
|
160
|
+
`docker rmi #{options.force ? '-f':''} #{imageinfo[2]}`
|
158
161
|
HighLine.say "Image <%= color('#{imagename}', RED)%> deleted"
|
159
162
|
end
|
160
163
|
end
|
data/lux.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Nick Townsend"]
|
10
10
|
spec.email = ["nick.townsend@mac.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Handy utilities for working with Docker
|
12
|
+
spec.summary = %q{Handy utilities for working with Docker}
|
13
13
|
spec.homepage = "https://github.com/townsen/lux"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
24
24
|
spec.add_runtime_dependency "highline", "~> 1.7"
|
25
|
+
spec.add_runtime_dependency "docker-api", "~> 1.22"
|
25
26
|
spec.add_runtime_dependency "rake", "~> 10.0"
|
26
27
|
|
27
28
|
spec.add_development_dependency "bundler", "~> 1.9"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Townsend
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: docker-api
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.22'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.22'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,5 +124,5 @@ rubyforge_project:
|
|
110
124
|
rubygems_version: 2.4.5
|
111
125
|
signing_key:
|
112
126
|
specification_version: 4
|
113
|
-
summary: Handy utilities for working with Docker
|
127
|
+
summary: Handy utilities for working with Docker
|
114
128
|
test_files: []
|