diff --git a/.go-version b/.go-version new file mode 100644 index 000000000..feaae22ba --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.13.0 diff --git a/Dockerfile b/Dockerfile index 0b2d518ad..638305fa8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM golang:latest +ARG GO_VERSION +FROM golang:${GO_VERSION:-1.13.0} RUN \ apt-get update \ @@ -20,5 +21,6 @@ RUN mage build # If we keep it, it means all packages exist twice. RUN rm -rf dev +ENTRYPOINT ["go", "run", "."] # Make sure it's accessible from outside the container -ENTRYPOINT ["go", "run", ".", "--address=0.0.0.0:8080"] +CMD ["--address=0.0.0.0:8080"] diff --git a/README.md b/README.md index cd49001c3..6aaa404a1 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,12 @@ There are several options to run this. ### Go command +To use the correct golang version, run: + +``` +gvm use $(cat .go-version) +``` + When using the go command, first the example packages must be built: `mage build`