|
1 | 1 | FROM ubuntu:jammy |
2 | 2 |
|
3 | | -ADD https://raw.githubusercontent.com/gitpod-io/workspace-images/main/base/install-packages /usr/bin/install-packages |
4 | | -RUN chmod +x /usr/bin/install-packages |
5 | | - |
6 | | -RUN install-packages \ |
7 | | - zip unzip \ |
8 | | - jq \ |
9 | | - curl \ |
10 | | - ca-certificates \ |
11 | | - file \ |
12 | | - git \ |
13 | | - node.js |
14 | | - |
15 | | -ENV GO_VERSION=1.24.0 |
16 | | -RUN echo "TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}" && \ |
17 | | - case "${TARGETPLATFORM:-linux/amd64}" in \ |
18 | | - "linux/arm64") \ |
19 | | - echo "GO_PLATFORM=linux-arm64" > /tmp/go_platform.env \ |
20 | | - ;; \ |
21 | | - *) \ |
22 | | - echo "GO_PLATFORM=linux-amd64" > /tmp/go_platform.env \ |
23 | | - ;; \ |
24 | | - esac |
25 | | - |
26 | | -# Install Go and add it to PATH |
27 | | -RUN . /tmp/go_platform.env && \ |
28 | | - curl -fsSL https://dl.google.com/go/go$GO_VERSION.$GO_PLATFORM.tar.gz | tar -C /usr/local -xzs |
29 | | - |
30 | | -# Set Go environment variables |
31 | | -ENV GOROOT=/usr/local/go |
32 | | -ENV PATH=$GOROOT/bin:$PATH |
33 | | -ENV GOPATH=/root/go |
34 | | -ENV PATH=$GOPATH/bin:$PATH |
35 | | - |
36 | | -# install VS Code Go tools for use with gopls as per https://github.com/golang/vscode-go/blob/master/docs/tools.md |
37 | | -# also https://github.com/golang/vscode-go/blob/27bbf42a1523cadb19fad21e0f9d7c316b625684/src/goTools.ts#L139 |
38 | | -RUN go install -v github.com/uudashr/gopkgs/cmd/gopkgs@v2 \ |
39 | | - && go install -v github.com/ramya-rao-a/go-outline@latest \ |
40 | | - && go install -v github.com/cweill/gotests/gotests@latest \ |
41 | | - && go install -v github.com/fatih/gomodifytags@latest \ |
42 | | - && go install -v github.com/josharian/impl@latest \ |
43 | | - && go install -v github.com/haya14busa/goplay/cmd/goplay@latest \ |
44 | | - && go install -v github.com/go-delve/delve/cmd/dlv@latest \ |
45 | | - && go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest \ |
46 | | - && go install -v golang.org/x/tools/gopls@latest \ |
47 | | - && go install -v honnef.co/go/tools/cmd/staticcheck@latest \ |
48 | | - && rm -rf /root/.cache |
49 | | - |
50 | | -ENV SHFMT_VERSION=3.10.0 |
51 | | -RUN curl -sSL -o /usr/local/bin/shfmt "https://github.com/mvdan/sh/releases/download/v${SHFMT_VERSION}/shfmt_v${SHFMT_VERSION}_linux_amd64" && \ |
52 | | - chmod 755 /usr/local/bin/shfmt |
53 | | - |
54 | 3 | # Install latest Leeway release |
55 | | -RUN . /tmp/go_platform.env && \ |
| 4 | +ENV GO_PLATFORM=linux-amd64 |
| 5 | +RUN apt-get update && apt-get install -y curl && \ |
56 | 6 | LATEST_LEEWAY_VERSION=$(curl -s https://api.github.com/repos/gitpod-io/leeway/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "v\([^"]*\)".*/\1/') && \ |
57 | 7 | curl -L -o /tmp/leeway.tar.gz https://github.com/gitpod-io/leeway/releases/download/v${LATEST_LEEWAY_VERSION}/leeway_Linux_${GO_PLATFORM#linux-}.tar.gz && \ |
58 | 8 | tar -xzf /tmp/leeway.tar.gz -C /tmp && \ |
59 | 9 | install -m 755 /tmp/leeway /usr/local/bin/ && \ |
60 | | - rm /tmp/leeway.tar.gz |
| 10 | + rm /tmp/leeway.tar.gz && \ |
| 11 | + apt-get clean && rm -rf /var/lib/apt/lists/* |
0 commit comments