Skip to content

Instantly share code, notes, and snippets.

@phuctm97
Created September 8, 2019 14:21
Show Gist options
  • Save phuctm97/d4bb370eabbdcdad216ef51b22b91b1b to your computer and use it in GitHub Desktop.
Save phuctm97/d4bb370eabbdcdad216ef51b22b91b1b to your computer and use it in GitHub Desktop.
Go RESTful series
FROM golang:1
# Configure to reduce warnings and limitations as instruction from official VSCode Remote-Containers.
# See https://code.visualstudio.com/docs/remote/containers-advanced#_reducing-dockerfile-build-warnings.
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed.
RUN apt-get -y install git iproute2 procps lsb-release
# Install Go tools.
RUN apt-get update \
# Install gocode-gomod.
&& go get -x -d github.com/stamblerre/gocode 2>&1 \
&& go build -o gocode-gomod github.com/stamblerre/gocode \
&& mv gocode-gomod $GOPATH/bin/ \
# Install other tools.
&& go get -u -v \
golang.org/x/tools/cmd/gopls \
github.com/mdempsky/gocode \
github.com/uudashr/gopkgs/cmd/gopkgs \
github.com/ramya-rao-a/go-outline \
github.com/acroca/go-symbols \
golang.org/x/tools/cmd/guru \
golang.org/x/tools/cmd/gorename \
github.com/go-delve/delve/cmd/dlv \
github.com/stamblerre/gocode \
github.com/rogpeppe/godef \
golang.org/x/tools/cmd/goimports \
golang.org/x/lint/golint 2>&1 \
# Clean up.
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Revert workaround at top layer.
ENV DEBIAN_FRONTEND=dialog
# Expose service ports.
EXPOSE 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment