clip/clips/expose

ログ

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
// プラグインインストール先
$ mkdir -p ~/.docker/cli-plugins

// clipをダウンロード
$ curl -sf https://raw.githubusercontent.com/lukaszlach/clip/master/docker-clip -o ~/.docker/cli-plugins/docker-clip
$ chmod +x ~/.docker/cli-plugins/docker-clip

$ docker clip

Usage: docker clip COMMAND

Commands:
add Install a new plugin by an image name
build Build a new plugin
ls List installed plugins
push Push local plugin to a Docker registry
rm Remove an installed plugin
search Search plugins from the remote catalog
update Reinstall a plugin to its latest version


// exposeをダウンロード
$ docker clip add lukaszlach/clips:expose

// 公開したいコンテナをrunする
$ docker run -d --name hoge nginx
92922d6d509277f47eea5851728c662d4076eb2e520737ae6f66f82e95ffc8f8

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92922d6d5092 nginx "nginx -g 'daemon of…" 2 seconds ago Up 1 second 80/tcp hoge

// exposeで80ポートを公開する(ngrok)
$ docker expose hoge 80
Creating network
Error: No such container: clip-expose
Starting proxy for hoge:80
Proxy is running, fetching public address details
http://0b3a5760.ngrok.io
https://0b3a5760.ngrok.io
Successfully exposed hoge:80

書いてるURLにアクセス→ ここでは http://0b3a5760.ngrok.io