我正在与 AmazonLinux 库合作,使用 Node.js 实现 lambda 函数。为此,我点击此链接: https://aws.amazon.com/blogs/networking-and-content-delivery/resizing-images-with-amazon-cloudfront-lambdaedge-aws-cdn-blog/
当我使用命令运行 DockerFile 时:
FROM amazonlinux
WORKDIR /tmp
#install the dependencies
RUN yum -y install gcc-c++ && yum -y install findutils
RUN touch ~/.bashrc && chmod +x ~/.bashrc
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
RUN source ~/.bashrc && nvm install 6.10
WORKDIR /build
我有以下配置:
- Ubuntu 16.04
- 节点:10.6.0
- npm:6.1.0
- nvm:0.30.2
按照 @Karol Samborki 的建议在 docker 镜像中添加 tar 库后,我收到此错误。
最佳答案
这绝对有效,您忘记添加 tar 和 gzip,因为它需要提取 nvm 包。
FROM amazonlinux
WORKDIR /tmp
#install the dependencies
RUN yum -y install gcc-c++ tar gzip findutils
RUN touch ~/.bashrc && chmod +x ~/.bashrc
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
RUN source ~/.bashrc && nvm install 6.10
WORKDIR /build
关于docker - 无法使用 Docker 安装 nvm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51204115/