Dockerfile & image & hub
在docker hub建立自己的儲存空間(registry)。練習上傳(push)在本地出的映像檔(image)到自己的儲存空間下的儲存庫(repository)。
step1 write a dockerfile
FROM node:12.22.1-alpineWORKDIR /appCOPY . .RUN npm installEXPOSE 8080CMD ["npm","run","dev" ]
step2 create a image
docker build -t node12-app .
step3 run image
give args
open on localhost
step4 set image with tag
local image name : node12-app my docker hub / repository name : jason0103/node12-app version : 1
docker tag node12-app jason0103/node12-app:1
step5
push the image to your registry of docker hub
docker push jason0103/node12-app:1