带有Cloud Foundry CLI的Golang Docker

时间:2018-11-08 17:53:43

标签: docker go dockerfile cloudfoundry docker-image

我使用以下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/

1 个答案:

答案 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中