본문 바로가기

프로그래밍 툴/Docker

ngrok로 로컬호스트 외부에서 접속하기

installation

  1. download file (e.g., ngrok-stable-linux-amd64.zip) from here
  2. extract compressed file
  3. locate it where PATH is set up so it can be available anywhere, e.g., /usr/local/bin

implementation

ngrok http <port-to-expose>

# e.g., for jenkins docker container created as below
$ docker run --name jenkins \
-d -p 8888:8080 \
-v jenkins_home:/var/jenkins_home \
jenkinsci/blueocean

# run ngrok as below:
$ ngrok http 8888

Session Status                online                                                                                                                     
Session Expires               7 hours, 59 minutes                                                                                                        
Version                       2.3.35                                                                                                                     
Region                        United States (us)                                                                                                         
Web Interface                 http://127.0.0.1:4040                                                                                                      
Forwarding                    http://f844933e6dce.ngrok.io -> http://localhost:8888                                                                      
Forwarding                    https://f844933e6dce.ngrok.io -> http://localhost:8888                                                                     

Connections                   ttl     opn     rt1     rt5     p50     p90                                                                                
                              0       0       0.00    0.00    0.00    0.00   

# localhost is then accessible via http://f844933e6dce.ngrok.io

'프로그래밍 툴 > Docker' 카테고리의 다른 글

Docker(도커)-Dockerfile  (0) 2020.07.21
Docker(도커)-images  (0) 2020.07.20
Docker (도커)- basics  (0) 2020.07.20