dip 6.0.0 → 6.1.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/README.md +18 -3
- data/lib/dip/cli/ssh.rb +4 -1
- data/lib/dip/commands/ssh.rb +10 -2
- data/lib/dip/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33e5ab547c594c58ea29e95555ac2d055480456f8427c1673db014a4d75388df
|
4
|
+
data.tar.gz: 2304c89be09d4ad6a348f3fe66492bcee50292b430df54d12902346cbb005aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58a00ed2d495ec460579afde5a6e1a7df48983d7979512985e2606b606ab8731aa3b281c1d0a3387534f147a3cd957a9d5884f69a7997fd72c402155e2c7c7c3
|
7
|
+
data.tar.gz: 34aa9e6d7739a39633431d8756446bc49be63ab9329b2afeaf6e6133745f1b84614d926ad5a13e50330bb7f6425604764d6cf51eae23cb0bf6f8643bc8d3e80c
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ A command-line utility that gives the "native" interaction with applications con
|
|
16
16
|
## Presentations and examples
|
17
17
|
|
18
18
|
- [Local development with Docker containers](https://slides.com/bibendi/dip)
|
19
|
-
- Dockerized Ruby on Rails applications: [one](https://github.com/bibendi/dip-example-rails), [
|
19
|
+
- Dockerized Ruby on Rails applications: [one](https://github.com/lewagon/rails-k8s-demo), [two](https://github.com/bibendi/dip-example-rails), [three](https://github.com/evilmartians/evil_chat)
|
20
20
|
- Dockerized Node.js application: [one](https://github.com/bibendi/twinkle.js), [two](https://github.com/bibendi/yt-graphql-react-event-booking-api)
|
21
21
|
- [Dockerized Ruby gem](https://github.com/bibendi/schked)
|
22
22
|
|
@@ -80,7 +80,7 @@ It can be found at [releases page](https://github.com/bibendi/dip/releases)
|
|
80
80
|
or type bellow into your terminal:
|
81
81
|
|
82
82
|
```sh
|
83
|
-
curl -L https://github.com/bibendi/dip/releases/download/v6.
|
83
|
+
curl -L https://github.com/bibendi/dip/releases/download/v6.1.0/dip-`uname -s`-`uname -m` > /usr/local/bin/dip
|
84
84
|
chmod +x /usr/local/bin/dip
|
85
85
|
```
|
86
86
|
|
@@ -237,7 +237,7 @@ dip VERSION=12352452 rake db:rollback
|
|
237
237
|
Use options `-p, --publish=[]` if you need to additionally publish a container's port(s) to the host unless this behaviour is not configured at dip.yml:
|
238
238
|
|
239
239
|
```sh
|
240
|
-
dip run -p 3000:3000 bundle exec rackup config.ru
|
240
|
+
dip run -p 3000:3000 bundle exec rackup config.ru
|
241
241
|
```
|
242
242
|
|
243
243
|
### dip ls
|
@@ -292,6 +292,21 @@ volumes:
|
|
292
292
|
name: ssh_data
|
293
293
|
```
|
294
294
|
|
295
|
+
if you want to use non-root user you can specify UID like so:
|
296
|
+
|
297
|
+
```
|
298
|
+
dip ssh up -u 1000
|
299
|
+
```
|
300
|
+
|
301
|
+
This especially helpful if you have something like this in your docker-compose.yml:
|
302
|
+
|
303
|
+
```
|
304
|
+
services:
|
305
|
+
web:
|
306
|
+
user: "1000:1000"
|
307
|
+
|
308
|
+
```
|
309
|
+
|
295
310
|
### dip nginx
|
296
311
|
|
297
312
|
Runs Nginx server container based on [bibendi/nginx-proxy](https://github.com/bibendi/nginx-proxy) image. An application's docker-compose.yml should contain environment variable `VIRTUAL_HOST` and `VIRTUAL_PATH` and connects to external network `frontend`.
|
data/lib/dip/cli/ssh.rb
CHANGED
@@ -16,6 +16,8 @@ module Dip
|
|
16
16
|
desc: 'Mounted docker volume'
|
17
17
|
method_option :interactive, aliases: '-t', type: :boolean, default: true,
|
18
18
|
desc: 'Run in interactive mode'
|
19
|
+
method_option :user, aliases: '-u', type: :string,
|
20
|
+
desc: 'UID for ssh-agent container'
|
19
21
|
# Backward compatibility
|
20
22
|
method_option :nonteractive, aliases: '-T', type: :boolean,
|
21
23
|
desc: 'Run in noninteractive mode'
|
@@ -26,7 +28,8 @@ module Dip
|
|
26
28
|
Dip::Commands::SSH::Up.new(
|
27
29
|
key: options.fetch(:key),
|
28
30
|
volume: options.fetch(:volume),
|
29
|
-
interactive: options.nonteractive? ? false : options.interactive
|
31
|
+
interactive: options.nonteractive? ? false : options.interactive?,
|
32
|
+
user: options.user
|
30
33
|
).execute
|
31
34
|
end
|
32
35
|
end
|
data/lib/dip/commands/ssh.rb
CHANGED
@@ -7,16 +7,20 @@ module Dip
|
|
7
7
|
module Commands
|
8
8
|
module SSH
|
9
9
|
class Up < Dip::Command
|
10
|
-
def initialize(key:, volume:, interactive:)
|
10
|
+
def initialize(key:, volume:, interactive:, user: nil)
|
11
11
|
@key = key
|
12
12
|
@volume = volume
|
13
13
|
@interactive = interactive
|
14
|
+
@user = user
|
14
15
|
end
|
15
16
|
|
16
17
|
def execute
|
17
18
|
subshell("docker", "volume create --name ssh_data".shellsplit, out: File::NULL, err: File::NULL)
|
18
19
|
|
19
|
-
subshell(
|
20
|
+
subshell(
|
21
|
+
"docker",
|
22
|
+
"run #{user_args} --detach --volume ssh_data:/ssh --name=ssh-agent whilp/ssh-agent".shellsplit
|
23
|
+
)
|
20
24
|
|
21
25
|
key = Dip.env.interpolate(@key)
|
22
26
|
subshell("docker", "run #{container_args} whilp/ssh-agent ssh-add #{key}".shellsplit)
|
@@ -24,6 +28,10 @@ module Dip
|
|
24
28
|
|
25
29
|
private
|
26
30
|
|
31
|
+
def user_args
|
32
|
+
"-u #{@user}" if @user
|
33
|
+
end
|
34
|
+
|
27
35
|
def container_args
|
28
36
|
result = %w(--rm)
|
29
37
|
volume = Dip.env.interpolate(@volume)
|
data/lib/dip/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bibendi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -183,8 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
|
-
|
187
|
-
rubygems_version: 2.7.7
|
186
|
+
rubygems_version: 3.0.8
|
188
187
|
signing_key:
|
189
188
|
specification_version: 4
|
190
189
|
summary: Ruby gem CLI tool for better interacting docker-compose files.
|