blob: b47b450e69917beb8864547126eeb98370fac293 [file] [log] [blame]
Philip Zeyligera442ce32025-05-28 02:48:26 +00001FROM ubuntu:24.04
Philip Zeyliger9df94b52025-05-18 03:43:14 +00002
3# Switch from dash to bash by default.
4SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
5
6# attempt to keep package installs lean
7RUN 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
Philip Zeyligera442ce32025-05-28 02:48:26 +000018# Install system packages including ca-certificates for Go downloads
Philip Zeyliger9df94b52025-05-18 03:43:14 +000019RUN apt-get update; \
20 apt-get install -y --no-install-recommends \
Philip Zeyligera442ce32025-05-28 02:48:26 +000021 ca-certificates wget \
Philip Zeyliger9df94b52025-05-18 03:43:14 +000022 git jq sqlite3 npm nodejs gh ripgrep fzf python3 curl vim chromium lsof iproute2 less && \
23 apt-get clean && \
24 rm -rf /var/lib/apt/lists/* && \
25 rm -rf /usr/share/{doc,doc-base,info,lintian,man,groff,locale,zoneinfo}/*
26
Philip Zeyligera442ce32025-05-28 02:48:26 +000027# Install Go 1.24
28ENV GO_VERSION=1.24.3
29ENV GOROOT=/usr/local/go
30ENV GOPATH=/go
31ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
32
33RUN ARCH=$(uname -m) && \
34 case $ARCH in \
35 x86_64) GOARCH=amd64 ;; \
36 aarch64) GOARCH=arm64 ;; \
37 *) echo "Unsupported architecture: $ARCH" && exit 1 ;; \
38 esac && \
39 wget -O go.tar.gz "https://golang.org/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz" && \
40 tar -C /usr/local -xzf go.tar.gz && \
41 rm go.tar.gz
42
43# Create GOPATH directory
44RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 755 "$GOPATH"
Philip Zeyliger9df94b52025-05-18 03:43:14 +000045
46# While these binaries install generally useful supporting packages,
47# the specific versions are rarely what a user wants so there is no
48# point polluting the base image module with them.
49
50RUN go install golang.org/x/tools/cmd/goimports@latest; \
51 go install golang.org/x/tools/gopls@latest; \
52 go install mvdan.cc/gofumpt@latest; \
53 go clean -cache -testcache -modcache
54
55ENV GOTOOLCHAIN=auto
56ENV SKETCH=1
57
58RUN mkdir -p /root/.cache/sketch/webui