Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit f16ae7f

Browse files
deansheatherNathan Potter
authored and
Nathan Potter
committed
fix GOPATH in ubuntu-dev-go image (#231)
1 parent 0336dfa commit f16ae7f

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

images/ubuntu-dev-go/Dockerfile.comm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66
# Changed FROM to be compatible with `buildfrom.sh`.
77
# Removed WORKDIR.
8+
# Removed GOPATH.
89

910
FROM %BASE
1011

@@ -51,7 +52,4 @@ RUN set -eux; \
5152
export PATH="/usr/local/go/bin:$PATH"; \
5253
go version
5354

54-
ENV GOPATH /go
55-
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
56-
57-
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
55+
ENV PATH /usr/local/go/bin:$PATH

images/ubuntu-dev-go/Dockerfile.lang

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
FROM %BASE
22

3+
# Set and create GOPATH directories.
4+
ENV GOPATH /home/user/go
5+
ENV PATH $GOPATH/bin:$PATH
6+
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
7+
38
ADD install_go_tools.sh /tmp/
49
RUN bash /tmp/install_go_tools.sh
510

images/ubuntu-dev-go/install_go_tools.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2-
# Taken from https://github.com/Microsoft/vscode-go/wiki/Go-tools-that-the-Go-extension-depends-on
32

3+
# Taken from https://github.com/Microsoft/vscode-go/wiki/Go-tools-that-the-Go-extension-depends-on
44
go get -u -v github.com/ramya-rao-a/go-outline
55
go get -u -v github.com/acroca/go-symbols
66
go get -u -v github.com/mdempsky/gocode
@@ -20,8 +20,14 @@ go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
2020
go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct
2121
go get -u -v github.com/alecthomas/gometalinter
2222

23-
~/go/bin/gometalinter --install
23+
go get -u -v github.com/go-delve/delve/cmd/dlv
24+
25+
# gocode-gomod needs to be built manually as the binary is renamed.
26+
go get -u -v -d github.com/stamblerre/gocode
27+
go build -o $GOPATH/bin/gocode-gomod github.com/stamblerre/gocode
2428

29+
# Install linters for gometalinter.
30+
$GOPATH/bin/gometalinter --install
2531

2632
# gopls is generally recommended over community tools.
2733
# It's much faster and more reliable than the other options.

0 commit comments

Comments
 (0)