Skip to content

docker/golang: fix brotli multi-stage build — empty submodule + cmake version#53

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/convert-to-multi-stage-build
Draft

docker/golang: fix brotli multi-stage build — empty submodule + cmake version#53
Copilot wants to merge 4 commits into
masterfrom
copilot/convert-to-multi-stage-build

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

Two cascading build failures in the brotli-builder stage:

  1. submodules/brotli is an uninitialised git submodule (empty dir), so COPY copied nothing and cmake errored with "does not appear to contain CMakeLists.txt"
  2. After fixing the source, ubuntu:bionic's system cmake (3.10.2) is too old — brotli at the pinned commit requires ≥ 3.15

Changes

  • Source acquisition: replace COPY submodules/brotli with git clone + git checkout at the pinned submodule commit (664952333), making the builder self-contained
  • CMake version: drop system cmake package from builder's apt deps; install CMake 3.31.0 from Kitware (same tarball the final stage already uses)
  • Supply-chain hardening: add SHA256 verification (sha256sum -c) to both cmake downloads — previously neither was verified
FROM ubuntu:bionic AS brotli-builder
RUN apt-get install build-essential git wget

RUN wget https://github.com/Kitware/CMake/releases/download/v3.31.0/cmake-3.31.0-linux-x86_64.tar.gz && \
    echo "0fcb338b...  cmake-3.31.0-linux-x86_64.tar.gz" | sha256sum -c && \
    tar xf cmake-3.31.0-linux-x86_64.tar.gz -C /usr --strip-components=1

RUN git clone https://github.com/google/brotli.git /tmp/brotli && \
    git -C /tmp/brotli checkout 664952333f675eb189b9d8dfefb1d33538cc41f6
Original prompt

This section details on the original issue you should resolve

<issue_title>[FEATURE] </issue_title>
<issue_description>### What feature would you like?

надо вот эту команду https://github.com/chipitsine/wal-g/blob/master/docker/golang/Dockerfile#L29-L32 преобразовать в multi stage build, чтобы исходная папка была в временном контейнере, а в образ вошел только результат

Why is this feature useful?

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot AI changed the title [WIP] Transform Dockerfile command to multi-stage build docker/golang: convert brotli build to multi-stage Dockerfile Mar 8, 2026
…e COPY

Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot AI changed the title docker/golang: convert brotli build to multi-stage Dockerfile docker/golang: multi-stage build with self-contained brotli compilation Mar 8, 2026
…oth cmake downloads

Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot AI changed the title docker/golang: multi-stage build with self-contained brotli compilation docker/golang: fix brotli multi-stage build — empty submodule + cmake version Mar 8, 2026
@chipitsine chipitsine force-pushed the master branch 2 times, most recently from 3633c51 to 81395bd Compare May 7, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] <what you want>

2 participants