我正在为我的 Elixir 应用程序准备一个 Docker 镜像。我用于esbuild
资产编译。
esbuild
使用作为npm
包安装。
Dockerfile:
# copy umbrella app
COPY ./apps/gpanel ./apps/gpanel
...
# compile assets
RUN mix assets.deploy
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
# copy umbrella app
COPY ./apps/gpanel ./apps/gpanel
...
# compile assets
RUN mix assets.deploy
Run Code Online (Sandbox Code Playgroud)
经过一番谷歌搜索后,我发现这是一个跨平台构建不兼容的问题。
根本原因是该node_modules
文件夹已从我的开发环境复制到 docker 上下文。
添加node_modules
即可.dockerignore
解决问题。