| Philip Zeyliger | 9df94b5 | 2025-05-18 03:43:14 +0000 | [diff] [blame] | 1 | FROM golang:1.24-bookworm |
| 2 | |
| 3 | # Switch from dash to bash by default. |
| 4 | SHELL ["/bin/bash", "-euxo", "pipefail", "-c"] |
| 5 | |
| 6 | # attempt to keep package installs lean |
| 7 | RUN printf '%s\n' \ |
| 8 | 'path-exclude=/usr/share/man/*' \ |
| 9 | 'path-exclude=/usr/share/doc/*' \ |
| 10 | 'path-exclude=/usr/share/doc-base/*' \ |
| 11 | 'path-exclude=/usr/share/info/*' \ |
| 12 | 'path-exclude=/usr/share/locale/*' \ |
| 13 | 'path-exclude=/usr/share/groff/*' \ |
| 14 | 'path-exclude=/usr/share/lintian/*' \ |
| 15 | 'path-exclude=/usr/share/zoneinfo/*' \ |
| 16 | > /etc/dpkg/dpkg.cfg.d/01_nodoc |
| 17 | |
| 18 | RUN apt-get update; \ |
| 19 | apt-get install -y --no-install-recommends \ |
| 20 | git jq sqlite3 npm nodejs gh ripgrep fzf python3 curl vim chromium lsof iproute2 less && \ |
| 21 | apt-get clean && \ |
| 22 | rm -rf /var/lib/apt/lists/* && \ |
| 23 | rm -rf /usr/share/{doc,doc-base,info,lintian,man,groff,locale,zoneinfo}/* |
| 24 | |
| 25 | ENV PATH="$GOPATH/bin:$PATH" |
| 26 | |
| 27 | # While these binaries install generally useful supporting packages, |
| 28 | # the specific versions are rarely what a user wants so there is no |
| 29 | # point polluting the base image module with them. |
| 30 | |
| 31 | RUN go install golang.org/x/tools/cmd/goimports@latest; \ |
| 32 | go install golang.org/x/tools/gopls@latest; \ |
| 33 | go install mvdan.cc/gofumpt@latest; \ |
| 34 | go clean -cache -testcache -modcache |
| 35 | |
| 36 | ENV GOTOOLCHAIN=auto |
| 37 | ENV SKETCH=1 |
| 38 | |
| 39 | RUN mkdir -p /root/.cache/sketch/webui |