github.com/bcskill/bcschain/v3@v3.4.9-beta2/.devcontainer/Dockerfile (about)

     1  # Update the VARIANT arg in devcontainer.json to pick an Go version
     2  ARG VARIANT=1
     3  FROM golang:${VARIANT}
     4  
     5  # This Dockerfile adds a non-root user with sudo access. Update the “remoteUser” property in
     6  # devcontainer.json to use it. More info: https://aka.ms/vscode-remote/containers/non-root-user.
     7  ARG USERNAME=vscode
     8  ARG USER_UID=1000
     9  ARG USER_GID=$USER_UID
    10  
    11  # Options for common setup script - SHA generated on release
    12  ARG INSTALL_ZSH="true"
    13  ARG UPGRADE_PACKAGES="false"
    14  ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
    15  ARG COMMON_SCRIPT_SHA="dev-mode"
    16  
    17  # Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
    18  RUN apt-get update \
    19      && export DEBIAN_FRONTEND=noninteractive \
    20      && apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \
    21      && curl -sSL  ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
    22      && ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} /tmp/common-setup.sh" | sha256sum -c -)) \
    23      && /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
    24      # Clean up
    25      && apt-get autoremove -y \
    26      && apt-get clean -y \
    27      && rm -rf /var/lib/apt/lists/*
    28  
    29  # Install Go tools
    30  ARG GO_TOOLS_WITH_MODULES="\
    31      golang.org/x/tools/gopls \
    32      honnef.co/go/tools/... \
    33      golang.org/x/tools/cmd/gorename \
    34      golang.org/x/tools/cmd/goimports \
    35      golang.org/x/tools/cmd/guru \
    36      golang.org/x/lint/golint \
    37      github.com/mdempsky/gocode \
    38      github.com/cweill/gotests/... \
    39      github.com/haya14busa/goplay/cmd/goplay \
    40      github.com/sqs/goreturns \
    41      github.com/josharian/impl \
    42      github.com/davidrjenni/reftools/cmd/fillstruct \
    43      github.com/uudashr/gopkgs/v2/cmd/gopkgs \
    44      github.com/ramya-rao-a/go-outline \
    45      github.com/acroca/go-symbols \
    46      github.com/godoctor/godoctor \
    47      github.com/rogpeppe/godef \
    48      github.com/zmb3/gogetdoc \
    49      github.com/fatih/gomodifytags \
    50      github.com/mgechev/revive \
    51      github.com/go-delve/delve/cmd/dlv"
    52  RUN mkdir -p /tmp/gotools \
    53      && cd /tmp/gotools \
    54      && export GOPATH=/tmp/gotools \
    55      # Go tools w/module support
    56      && export GO111MODULE=on \
    57      && (echo "${GO_TOOLS_WITH_MODULES}" | xargs -n 1 go get -x )2>&1 \
    58      # gocode-gomod
    59      && export GO111MODULE=auto \
    60      && go get -x -d github.com/stamblerre/gocode 2>&1 \
    61      && go build -o gocode-gomod github.com/stamblerre/gocode \
    62      # golangci-lint
    63      && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin 2>&1 \
    64      # Move Go tools into path and clean up
    65      && mv /tmp/gotools/bin/* /usr/local/bin/ \
    66      && mv gocode-gomod /usr/local/bin/ \
    67      && rm -rf /tmp/gotools
    68  
    69  ENV GO111MODULE=auto
    70  
    71  # [Optional] Uncomment the next line to use go get to install anything else you need
    72  # RUN go get -x <your-dependency-or-tool>
    73  
    74  # [Optional] Uncomment this section to install additional OS packages.
    75  # RUN apt-get update \
    76  #     && export DEBIAN_FRONTEND=noninteractive \
    77  #     && apt-get -y install --no-install-recommends <your-package-list-here>