【问题标题】:pm2-runtime executable file not found in $PATH在 $PATH 中找不到 pm2-runtime 可执行文件
【发布时间】:2018-10-04 18:40:23
【问题描述】:

主机正在运行 MacOS X High Sierra

在 docker 容器中运行 NodeJS 应用程序。

使用Docker PM2 集成,即pm2-runtime

Docker 版本

$ docker version
Client:
 Version:   18.04.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    3d479c0
 Built: Tue Apr 10 18:13:16 2018
 OS/Arch:   darwin/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:  18.04.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   3d479c0
  Built:    Tue Apr 10 18:23:05 2018
  OS/Arch:  linux/amd64
  Experimental: true

Dockerfile

FROM node:alpine

COPY . ./app

WORKDIR /app
RUN npm install --no-optional
RUN npm install bcrypt --no-optional
RUN npm install bcrypt pm2 --no-optional

ENV NODE_ENV staging
CMD ["pm2-runtime", "ecosystem.config.json"]

EXPOSE 3000
EXPOSE 8443

运行日志

docker run -p 3000:3000 -p 8443:8443 -i -t wrapper:0.2
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"pm2-runtime\": executable file not found in $PATH": unknown.

任何指针?

【问题讨论】:

  • 我也遇到了同样的问题,你运气好吗?

标签: docker dockerfile pm2


【解决方案1】:

像全局安装pm2

npm install pm2 -g

或者传递pm2-runtime完整路径。

【讨论】:

    猜你喜欢
    • 2017-04-28
    • 1970-01-01
    • 2019-01-16
    • 2015-01-25
    • 2015-05-19
    • 1970-01-01
    • 1970-01-01
    • 2021-11-23
    • 2017-09-25
    相关资源
    最近更新 更多