# Docker Learning >[color=#B40431]下載官方的最新版本的鏡像: >>[color=#333333]docker pull node:latest >[color=#B40431]docker run --restart=always -d -it -p 3000:3000 -v /usr/node:/storage --name node-test node >>[color=#333333] 執行images >>[color=#333333] --restart=always:如果container停止即重新啟動 >>[color=#333333] -d:run指令的無數值參數,背景執行 >>[color=#333333] -i:--interactive (互動模式) >>[color=#333333] -t:--tty (配置一個終端機) >>[color=#333333] (以上兩個指令簡寫為-it) >>[color=#333333] -p:左邊是host的port號,右邊是container的port號 >>[color=#333333] -v:實體主機的資料夾(/usr/node)路徑Mapping到Container的資料夾(/storage)路徑 >>[color=#333333] --name node-test:指定這個Container的名字為node-test >[color=#B40431]docker exec -it node-test /bin/bash >>[color=#333333] 進入容器 >[color=#B40431]cd storage >>[color=#333333] 切換至指定資料夾 >[color=#B40431]node index.js >>[color=#333333] 執行index.js ```javascript= index.js var vhttp = require("http"); function onRequest(req, res) { console.log("Request received."); res.writeHead(200, {"Content-Type": "text/plain"}); res.write("Hello World"); res.end(); } vhttp.createServer(onRequest).listen(3000); console.log("Server has started to listen at port: 3000."); ```