问题:
我正在尝试创建一个 Dockerfile 来安装所有组件以运行 Go、安装GVM (Go Version Management)并安装特定的 Go 版本。
错误:
当我尝试使用以下方法构建容器时:
docker build -t ##### .
我收到此错误:
/bin/sh: 1: gvm: 未找到
命令“/bin/sh -c gvm install go1.4 -B”返回非零代码:127
安装在这里:
/root/.gvm/scripts/env/gvm
/root/.gvm/scripts/gvm
/root/.gvm/bin/gvm
我尝试了什么:
它显然能够安装 GVM 但无法使用它。为什么?我想也许我需要刷新.bashrc
or the .bash_profile
... 但这不起作用,因为它们不存在。
Dockerfile:
FROM #####/#####
#Installing Golang dependencies
RUN apt-get -y install curl git mercurial make binutils bison gcc build-essential
#Installing Golang
RUN ["/bin/bash", "-c", "bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)"]
#gvm does not exist here... why?
RUN gvm install go1.4 -B
RUN gvm use go1.4
问题:
为什么 GVM 似乎没有安装?如何摆脱错误?