...
1FROM golang:1.21.6
2
3ENV NVM_DIR="/usr/local/share/nvm"
4ENV NVM_SYMLINK_CURRENT=true \
5 PATH=${NVM_DIR}/current/bin:${PATH}
6
7ARG VSCODE_SCRIPTS_VERSION="v0.193.0"
8ARG NODE_VERSION="10"
9# Run some common installation scripts for a nicer dev environment. In order:
10# Used to create non-root user and update system packages
11# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
12# We use this to install Go tools used by gopls
13# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/go.md
14# We use this to install Node
15# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/node.md
16RUN apt-get update && \
17 wget "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_SCRIPTS_VERSION}/script-library/common-debian.sh" && \
18 chmod +x ./common-debian.sh && \
19 ./common-debian.sh false vscode automatic automatic true false && \
20 wget "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_SCRIPTS_VERSION}/script-library/go-debian.sh" && \
21 chmod +x ./go-debian.sh && \
22 ./go-debian.sh none /usr/local/go /go vscode false true && \
23 wget "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_SCRIPTS_VERSION}/script-library/node-debian.sh" && \
24 chmod +x ./node-debian.sh && \
25 ./node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" vscode true && \
26 rm common-debian.sh go-debian.sh node-debian.sh && \
27 DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
28 wget \
29 unzip \
30 openjdk-11-jre \
31 bzip2 \
32 patch && \
33 apt-get clean -y && \
34 rm -rf /var/lib/apt/lists/*
35
36# Install swagger-codegen
37ENV SWAGGER_CODEGEN_VERSION=2.4.8
38RUN wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${SWAGGER_CODEGEN_VERSION}/swagger-codegen-cli-${SWAGGER_CODEGEN_VERSION}.jar \
39 -O /usr/local/bin/swagger-codegen-cli.jar && \
40 echo '#!/bin/bash\njava -jar /usr/local/bin/swagger-codegen-cli.jar "$@"' > /usr/local/bin/swagger-codegen && \
41 chmod +x /usr/local/bin/swagger-codegen
42
43# Install Bazelisk as bazel to manage Bazel
44RUN go install github.com/bazelbuild/bazelisk@latest && \
45 mv $(which bazelisk) /usr/local/bin/bazel
46
47# Install buildifier for bazel formatting
48RUN go install github.com/bazelbuild/buildtools/buildifier@latest
49
50# Give vscode ownership of GOPATH
51RUN chown -R vscode: /go
52
53USER vscode
View as plain text