Deploy Go-WebApp with Docker

Lyn Lyn
Mar 1, 2021
  1. 在 WSL2 terminal 建立資料夾,自訂名 go-app
  2. 資料夾內建立 Dockerfile, go.mod, main.go
Dockerfile
main.go

3. docker build:建立 image file ,命名 lynlyn/my-go-app

create image file

4. docker images:確認 image file 建立成功

check image file just created

5. docker run:執行指定的 image,port mapping [local machine port] : [container port],local machine port 和 container port 不需相同

run image file just created

6. local machine 開啟瀏覽器,URI:"localhost:8081"

check on local browser

7. 由 URI 輸入 request

send request from URI

--

--