Problem:
I'm attempting to create a Dockerfile that installs all the components to run Go, to install GVM (Go Version Management), and to install specific Go Versions.
Error:
When I try building the container with:
docker build -t ##### .
I get this error:
/bin/sh: 1: gvm: not found
The command '/bin/sh -c gvm install go1.4 -B' returned a non-zero code: 127
Installed here:
/root/.gvm/scripts/env/gvm
/root/.gvm/scripts/gvm
/root/.gvm/bin/gvm
What I tried:
It's clearly able to install GVM but unable to use it. Why?
I thought maybe I needed to refresh the .bashrc
or the .bash_profile
... but that didn't work, since they don't exist.
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
Question:
Why does GVM not seem to be installed? How do I get rid of the error?
gvm
? Is it in your path? Why do you needgvm
in a container, which is usually purpose-built for an application? – Flameout