注意:对于Windows和Docker来说都是新手
我一直在使用的教程说,/var/lib/docker/containers如果我们使用的是Linux,它们就在使用,但我似乎无法在我的Windows机器上找到它.
谢谢!
我正在构建一个Dockerfile中的图像,并且我构建映像时我的npm安装依赖项的部分是错误的,但我可以在它之外运行命令.我不确切地知道这个错误的来源.
我在Windows上使用boot2docker,我的Dockerfile是:
FROM ubuntu:15.04
RUN apt-get -y update
RUN apt-get -y install nodejs
RUN apt-get -y install npm
COPY /server /src
COPY /server/package.json /tmp/package.json
RUN cd /tmp && npm install
(etc)
Run Code Online (Sandbox Code Playgroud)
错误消息是:
sh:1 node: not found
npm WARN: This failure might be due to the use of legacy binary "node"
npm WARN: For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! sails@0.11.0 preinstall: 'node ./lib/preinstall_npmcheck.js'
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the sails@0.11.0 preinstall script.
npm …Run Code Online (Sandbox Code Playgroud) 我使用Docker部署了一个单容器SailsJS应用程序(映像大小约为597.4 MB),并将其连接到ElasticBeanstalk.
但是,由于ECS是为Docker构建的,那么在EB上使用它可能会更好吗?
答案:我仍然不知道出了什么问题,但是在我重新启动docker并再次运行它(相同的dockerfile,同样的一切)后,它运行正常.
我在Windows上使用Docker而我的Dockerfile是
FROM ubuntu:15.04
COPY . /src
RUN apt-get update
RUN apt-get install -y nodejs
...etc
Run Code Online (Sandbox Code Playgroud)
但是当我尝试构建我得到的图像时
WARN[0001] SECURITY WARNING: You are building a Docker image from Windows against a Linux Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories
...
Step 3: RUN apt-get -y update
--> Using cache
--->ccd4120f98dd
Removing intermediate container 255796bdef29
Step 4: RUN apt-get install …Run Code Online (Sandbox Code Playgroud) docker ×4
windows ×3
amazon-ecs ×1
apt-get ×1
containers ×1
deployment ×1
dockerfile ×1
image ×1
node.js ×1
npm ×1
sails.js ×1