我在docker中创建了nodered应用程序,我尝试重建docker,因为我需要使用其他cli工具.e、 g:aws



我需要部署到fargate,但nodered重建将遵循hostname创建flow.json,这让我很难将旧配置加载到新nodered。但现在,如果使用docker run-h是有效的,但在fargate中不起作用,我该怎么办?

当然,发布nodered docker版本就解决了这个问题,但我不知道如何调用cli工具,如果基于nodered,我如何安装aws-cli2并在nodered仪表板中调用它?

FROM nodered/node-red:latest
#USER root
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip
RUN unzip awscliv2.zip
RUN ./aws/install
CMD ["node-red"]

正确的Dockerfile应该是:

FROM nodered/node-red:latest
USER root
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip
RUN unzip awscliv2.zip
RUN ./aws/install
RUN rm -rf ./aws
USER node-red

但问题是,该映像基于Alpine Linux,该Linux使用musl标准库而不是glibc。而且AWS工具将无法与此运行时配合使用。

最简单的解决方案是使用我在第一条评论中提到的基于Debian的构建。它的docker文件可以在这里找到,按照那里的说明使用docker-debian.sh,它将创建一个名为testing:node-red-build,然后可以用作我前面展示的Dockerfile的基础:

FROM testing:node-red-build
USER root
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip
RUN unzip awscliv2.zip
RUN ./aws/install
RUN rm -rf ./aws
USER node-red

最新更新