我使用以下dockerfile,并且在构建和运行它时出现错误**unknown command cf**
,我设置了env,我希望在运行cf -v
时它将打印该版本,可以是?
FROM golang:1.10.5
ENV CF_CLI_VERSION "6.40.0"
RUN ln -s /lib/ /lib64
RUN apt-get update && apt-get install curl -y
ENV CF_HOME=/usr/local/bin
RUN curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&version=${CF_CLI_VERSION}" | tar -zx -C /usr/local/
答案 0 :(得分:3)
您可能要将最后一行更改为
RUN curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&version=${CF_CLI_VERSION}" | tar -zx -C /usr/local/bin
/usr/local
默认不在PATH中