Get the URL issued by ngrok with the Docker expose plugin

Docker expose plugin finally sets up a container called clip-expose, but unfortunately it doesn't forward the 4040 port so I can't get the URL on localhost: 4040.

You can get the json file containing the URL by checking the IP of the clip-expose container and setting `` `http: // [container IP]: 4040/api/tunnels```, but use the docker expose command. Since the IP seems to change every time, it is meaningless to check it one by one, so I checked it,

Reference: How to get IP address of running docker container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

It seems that you can get the IP of the container with this, so

curl http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' clip-expose):404
0/api/tunnels

If so, it seems that you can get the json file including the URL.

Recommended Posts

Get the URL issued by ngrok with the Docker expose plugin
Use ngrok with Docker
Get only the ID of the container specified by docker ps
Get started with DynamoDB with docker
Gats by new with yarn (Docker)
Android development-WEB access (GET) Try to get data by communicating with the outside. ~
Get the value of enum saved in DB by Rails with attribute_before_type_cast
Create external (URL) monitoring with Docker + Prometheus
[Java] Get the date with the LocalDateTime class
Enclose the URL in TXT received by JSP with an automatic link tag
Build Apache and Tomcat environment with Docker. By the way, Maven & Java cooperation