Ismaël Mejía created AVRO-4272:
----------------------------------

             Summary: Modernize share/docker/Dockerfile with BuildKit and 
reduce image size
                 Key: AVRO-4272
                 URL: https://issues.apache.org/jira/browse/AVRO-4272
             Project: Apache Avro
          Issue Type: Improvement
          Components: build
            Reporter: Ismaël Mejía


The shared Docker build image (share/docker/Dockerfile) has accumulated 
technical debt over time. This patch modernizes it for current Docker best 
practices and reduces image size.

Changes:
* Replace {{libboost-all-dev}} (~70+ sub-packages) with the four Boost packages 
actually needed by the C++ test suite: {{libboost-dev}}, {{libboost-test-dev}}, 
{{libboost-random-dev}}, {{libboost-math-dev}}
* Use BuildKit cache mounts ({{--mount=type=cache}}) for apt, npm, cpanm, and 
bundler — eliminates repeated {{apt-get update}}/{{clean}} cycles, produces 
smaller layers, and speeds up rebuilds
* Use BuildKit bind mounts for Ruby gem resolution (replaces COPY layers)
* Add {{# syntax=docker/dockerfile:1}} directive for portability
* Remove redundant packages provided by {{build-essential}} (g++, gcc, make) or 
by other -dev packages (libsnappy1v5)
* Remove {{apt-transport-https}} (unnecessary on Ubuntu 24.04)
* Add {{--no-install-recommends}} to all {{apt-get install}} calls
* Fix .NET SDK install to use {{&&}} instead of {{;}} (fail-fast on errors)
* Convert build-only variables (MAVEN_VERSION, APACHE_DIST_URLS, PHP8_VERSION) 
from ENV to ARG
* Remove dead {{PIP_NO_CACHE_DIR=off}} (misleading and moot with uv)
* Move Ruby bundle install after .NET/Java layers for better cache efficiency
* Fix PHP extension build to use {{/tmp/lang/php}} (consistent naming, proper 
cleanup)

Requires Docker BuildKit (default builder since Docker 23.0 / February 2023).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to