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

i created nodered application in docker , i tried rebuild docker because i need using other cli tools. e,g:aws cli

我需要部署到 fargate,但是 nodered 重建将按照主机名创建 flow.json,这让我很难将旧配置加载到新的 nodered。 但是现在,如果使用 docker 运行 -h 可以,但在 fargate 中不起作用,我该怎么办?

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

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 的,它使用 musl 标准库而不是 glibc。并且 AWS 工具不会 work 此运行时。

最简单的解决方案是使用我在第一条评论中提到的基于 Debian 的构建。 docker 文件可以在 here 中找到,按照那里的说明使用 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