我正在尝试构建一个 dockerfile,其中我刚刚启动一个 http 服务器。我的docker文件是:
FROM ubuntu
RUN apt-get update
RUN apt-get install -y nodejs && apt-get install -y npm
COPY testing /testing
RUN cd testing
RUN npm install
ENTRYPOINT npm start
Run Code Online (Sandbox Code Playgroud)
这里的testing是项目目录,由一个index.html文件和package.json.
我的 package.json 是:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "http-server -a 0.0.0.0 -p 5500"
},
"author": "",
"license": "ISC",
"dependencies": {
"concurrently": "^5.0.2",
"http-server": "^0.12.1"
}
}
Run Code Online (Sandbox Code Playgroud)
在我的本地计算机中,服务器工作正常。我认为该cd …