This is a plugin for Insomnia that provides a host port number for a docker container.
You can get container name and port with docker ps
.
$ docker ps --format "table {{.Names}}\t{{.Ports}}"
NAMES PORTS
foo 0.0.0.0:32768->80/tcp
bar 0.0.0.0:32770->80/tcp
Container foo will return 32768.
Place the plugin in a directory that Insomnia knows about.
- Linux:
$XDG_CONFIG_HOME/Insomnia/plugins/
or~/.config/Insomnia/plugins/
- MacOS:
~/Library/Application\ Support/Insomnia/plugins/
- Windows:
%APPDATA%\Insomnia\plugins\
$ git clone https://github.com/ttrig/insomnia-plugin-dockerport.git
$ cd insomnia-plugin-dockerport
$ npm install
Install the plugin from Preferences > Plugins
.
Run dockerd with -H tcp://0.0.0.0:2376
to
make the Docker daemon listen for Docker Engine API requests via tcp.