diff --git a/containers/base/Containerfile b/containers/base/Containerfile index e674b2c..a22b77d 100644 --- a/containers/base/Containerfile +++ b/containers/base/Containerfile @@ -7,12 +7,20 @@ RUN --mount=type=cache,id=dnf-cache,target=/var/cache/libdnf5 \ bash-completion git-core fzf curl awk jq rg unzip which \ host-spawn wl-copy gcc tree-sitter-cli -RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | jq -r .tag_name | sed 's/^v//') && \ - curl -sL "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazygit && \ - curl -sL "https://github.com/jorgerojas26/lazysql/releases/latest/download/lazysql_Linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazysql && \ - curl -sL "https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz" | tar xz -C /usr/local --strip-components=1 && \ - curl -fsSL https://bun.sh/install | BUN_INSTALL="/usr/local" bash && \ - ln -sf /usr/local/bin/bun /usr/local/bin/node && \ +# === install tools (least to most frequently changing) === +RUN set -o pipefail && \ + LAZYGIT_URL=$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/jesseduffield/lazygit/releases/latest) && \ + curl -fsSL "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_URL##*/v}_linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazygit && \ + curl -fsSL "https://github.com/jorgerojas26/lazysql/releases/latest/download/lazysql_Linux_x86_64.tar.gz" | tar xz -C /usr/local/bin lazysql + +RUN set -o pipefail && \ + curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local bash && \ + ln -sf /usr/local/bin/bun /usr/local/bin/node + +RUN set -o pipefail && \ + curl -fsSL https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz | tar xz -C /usr/local --strip-components=1 + +RUN set -o pipefail && \ curl -fsSL https://claude.ai/install.sh | bash && \ cp -L /root/.local/bin/claude /usr/local/bin/ && \ rm -rf /root/.local diff --git a/containers/go/Containerfile b/containers/go/Containerfile index dbbc99f..fbf4e87 100644 --- a/containers/go/Containerfile +++ b/containers/go/Containerfile @@ -2,14 +2,23 @@ ARG TAG FROM job79/base:${TAG} USER root -RUN GO_VERSION=$(curl -sL "https://go.dev/VERSION?m=text" | head -n 1 | tr -d '\r\n') && \ - curl -sL "https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz" | tar xz -C /usr/local && \ - ln -sf /usr/local/go/bin/go /usr/local/bin/go && \ - ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt && \ - GOBIN=/usr/local/bin /usr/local/go/bin/go install golang.org/x/tools/gopls@latest && \ - GOBIN=/usr/local/bin /usr/local/go/bin/go install mvdan.cc/gofumpt@latest && \ - GOBIN=/usr/local/bin /usr/local/go/bin/go install golang.org/x/tools/cmd/goimports@latest && \ - GOBIN=/usr/local/bin /usr/local/go/bin/go install github.com/go-delve/delve/cmd/dlv@latest && \ - BUN_INSTALL="/usr/local" bun install -g typescript typescript-language-server @tailwindcss/language-server svelte-language-server @biomejs/biome +RUN set -o pipefail && \ + GO_VERSION=$(curl -fsSL "https://go.dev/VERSION?m=text" | head -n 1 | tr -d '\r\n') && \ + curl -fsSL "https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz" | tar xz -C /usr/local && \ + ln -sf /usr/local/go/bin/go /usr/local/go/bin/gofmt /usr/local/bin/ + +# Build caches live in cache mounts so they don't end up in the image. +RUN --mount=type=cache,id=go-mod,target=/root/go/pkg/mod \ + --mount=type=cache,id=go-build,target=/root/.cache/go-build \ + for pkg in \ + golang.org/x/tools/gopls \ + golang.org/x/tools/cmd/goimports \ + mvdan.cc/gofumpt \ + github.com/go-delve/delve/cmd/dlv; \ + do GOBIN=/usr/local/bin go install "$pkg@latest" || exit 1; done + +RUN --mount=type=cache,id=bun-cache,target=/root/.bun-cache \ + BUN_INSTALL=/usr/local BUN_INSTALL_CACHE_DIR=/root/.bun-cache bun install -g \ + typescript typescript-language-server @tailwindcss/language-server svelte-language-server @biomejs/biome USER user