File: Dockerfile

package info (click to toggle)
golang-github-grpc-ecosystem-grpc-gateway.v2 2.11.3-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,148 kB
  • sloc: javascript: 352; makefile: 136; sh: 26
file content (53 lines) | stat: -rw-r--r-- 2,460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM golang:1.19.0

ENV NVM_DIR="/usr/local/share/nvm"
ENV NVM_SYMLINK_CURRENT=true \
    PATH=${NVM_DIR}/current/bin:${PATH}

ARG VSCODE_SCRIPTS_VERSION="v0.193.0"
ARG NODE_VERSION="10"
# Run some common installation scripts for a nicer dev environment. In order:
# Used to create non-root user and update system packages
# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
# We use this to install Go tools used by gopls
# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/go.md
# We use this to install Node
# https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/node.md
RUN apt-get update && \
    wget "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_SCRIPTS_VERSION}/script-library/common-debian.sh" && \
    chmod +x ./common-debian.sh && \
    ./common-debian.sh false vscode automatic automatic true false && \
    wget "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_SCRIPTS_VERSION}/script-library/go-debian.sh" && \
    chmod +x ./go-debian.sh && \
    ./go-debian.sh none /usr/local/go /go vscode false true && \
    wget "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/${VSCODE_SCRIPTS_VERSION}/script-library/node-debian.sh" && \
    chmod +x ./node-debian.sh && \
    ./node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" vscode true && \
    rm common-debian.sh go-debian.sh node-debian.sh && \
    DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
        wget \
        unzip \
        openjdk-11-jre \
        bzip2 \
        patch && \
    apt-get clean -y && \
    rm -rf /var/lib/apt/lists/*

# Install swagger-codegen
ENV SWAGGER_CODEGEN_VERSION=2.4.8
RUN wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${SWAGGER_CODEGEN_VERSION}/swagger-codegen-cli-${SWAGGER_CODEGEN_VERSION}.jar \
    -O /usr/local/bin/swagger-codegen-cli.jar && \
    echo '#!/bin/bash\njava -jar /usr/local/bin/swagger-codegen-cli.jar "$@"' > /usr/local/bin/swagger-codegen && \
	chmod +x /usr/local/bin/swagger-codegen

# Install Bazelisk as bazel to manage Bazel
RUN go install github.com/bazelbuild/bazelisk@latest && \
    mv $(which bazelisk) /usr/local/bin/bazel

# Install buildifier for bazel formatting
RUN go install github.com/bazelbuild/buildtools/buildifier@latest

# Give vscode ownership of GOPATH
RUN chown -R vscode: /go

USER vscode