blob: b47b450e69917beb8864547126eeb98370fac293 [file] [log] [blame]
FROM ubuntu:24.04
# Switch from dash to bash by default.
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
# attempt to keep package installs lean
RUN printf '%s\n' \
'path-exclude=/usr/share/man/*' \
'path-exclude=/usr/share/doc/*' \
'path-exclude=/usr/share/doc-base/*' \
'path-exclude=/usr/share/info/*' \
'path-exclude=/usr/share/locale/*' \
'path-exclude=/usr/share/groff/*' \
'path-exclude=/usr/share/lintian/*' \
'path-exclude=/usr/share/zoneinfo/*' \
> /etc/dpkg/dpkg.cfg.d/01_nodoc
# Install system packages including ca-certificates for Go downloads
RUN apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates wget \
git jq sqlite3 npm nodejs gh ripgrep fzf python3 curl vim chromium lsof iproute2 less && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /usr/share/{doc,doc-base,info,lintian,man,groff,locale,zoneinfo}/*
# Install Go 1.24
ENV GO_VERSION=1.24.3
ENV GOROOT=/usr/local/go
ENV GOPATH=/go
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
RUN ARCH=$(uname -m) && \
case $ARCH in \
x86_64) GOARCH=amd64 ;; \
aarch64) GOARCH=arm64 ;; \
*) echo "Unsupported architecture: $ARCH" && exit 1 ;; \
esac && \
wget -O go.tar.gz "https://golang.org/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz" && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
# Create GOPATH directory
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 755 "$GOPATH"
# While these binaries install generally useful supporting packages,
# the specific versions are rarely what a user wants so there is no
# point polluting the base image module with them.
RUN go install golang.org/x/tools/cmd/goimports@latest; \
go install golang.org/x/tools/gopls@latest; \
go install mvdan.cc/gofumpt@latest; \
go clean -cache -testcache -modcache
ENV GOTOOLCHAIN=auto
ENV SKETCH=1
RUN mkdir -p /root/.cache/sketch/webui