1
+ # -------------------------------------------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4
+ # -------------------------------------------------------------------------------------------------------------
5
+
6
+ FROM golang:1
7
+
8
+ # Avoid warnings by switching to noninteractive
9
+ ENV DEBIAN_FRONTEND=noninteractive
10
+
11
+ # This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
12
+ # this user's GID/UID must match your local user UID/GID to avoid permission issues
13
+ # with bind mounts. Update USER_UID / USER_GID if yours is not 1000. See
14
+ # https://aka.ms/vscode-remote/containers/non-root-user for details.
15
+ ARG USERNAME=vscode
16
+ ARG USER_UID=1000
17
+ ARG USER_GID=$USER_UID
18
+
19
+ # Configure apt, install packages and tools
20
+ RUN apt-get update \
21
+ && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
22
+ #
23
+ # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
24
+ && apt-get -y install git iproute2 procps lsb-release \
25
+ #
26
+ # Install gocode-gomod
27
+ && go get -x -d github.com/stamblerre/gocode 2>&1 \
28
+ && go build -o gocode-gomod github.com/stamblerre/gocode \
29
+ && mv gocode-gomod $GOPATH/bin/ \
30
+ #
31
+ # Install Go tools
32
+ && go get -u -v \
33
+ github.com/mdempsky/gocode \
34
+ github.com/uudashr/gopkgs/cmd/gopkgs \
35
+ github.com/ramya-rao-a/go-outline \
36
+ github.com/acroca/go-symbols \
37
+ github.com/godoctor/godoctor \
38
+ golang.org/x/tools/cmd/guru \
39
+ golang.org/x/tools/cmd/gorename \
40
+ github.com/rogpeppe/godef \
41
+ github.com/zmb3/gogetdoc \
42
+ github.com/haya14busa/goplay/cmd/goplay \
43
+ github.com/sqs/goreturns \
44
+ github.com/josharian/impl \
45
+ github.com/davidrjenni/reftools/cmd/fillstruct \
46
+ github.com/fatih/gomodifytags \
47
+ github.com/cweill/gotests/... \
48
+ golang.org/x/tools/cmd/goimports \
49
+ golang.org/x/lint/golint \
50
+ golang.org/x/tools/cmd/gopls \
51
+ github.com/alecthomas/gometalinter \
52
+ honnef.co/go/tools/... \
53
+ github.com/golangci/golangci-lint/cmd/golangci-lint \
54
+ github.com/mgechev/revive \
55
+ github.com/derekparker/delve/cmd/dlv 2>&1 \
56
+ #
57
+ # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
58
+ && groupadd --gid $USER_GID $USERNAME \
59
+ && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
60
+ # [Optional] Add sudo support
61
+ && apt-get install -y sudo \
62
+ && echo $USERNAME ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
63
+ && chmod 0440 /etc/sudoers.d/$USERNAME \
64
+ #
65
+ # Clean up
66
+ && apt-get autoremove -y \
67
+ && apt-get clean -y \
68
+ && rm -rf /var/lib/apt/lists/*
0 commit comments