@@ -64,111 +64,124 @@ jobs:
6464 echo "Building and pushing base images to GHCR..."
6565 echo "Repository: ${REPO_LOWER}"
6666
67- # Build all stages and push them as separate images
68- # These images contain the heavy, rarely-changing components
67+ # Define all build args once to avoid repetition
68+ # All args must be passed to each build to avoid "blank base name" errors
69+ BUILD_ARGS="
70+ --build-arg PYSPY_RUST_BUILDER_VERSION=@sha256:541a1720c1cedddae9e17b4214075bf57c20bc7b176b4bba6bce3437c44d51ef
71+ --build-arg RBSPY_RUST_BUILDER_VERSION=@sha256:65b63b7d003f7a492cc8e550a4830aaa1f4155b74387549a82985c8efb3d0e88
72+ --build-arg PERF_BUILDER_UBUNTU=@sha256:dca176c9663a7ba4c1f0e710986f5a25e672842963d95b960191e2d9f7185ebe
73+ --build-arg PHPSPY_BUILDER_UBUNTU=@sha256:cf31af331f38d1d7158470e095b132acd126a7180a54f263d386da88eb681d93
74+ --build-arg AP_BUILDER_CENTOS=@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e
75+ --build-arg AP_BUILDER_ALPINE=@sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a
76+ --build-arg AP_CENTOS_MIN=:6
77+ --build-arg BURN_BUILDER_GOLANG=@sha256:f7d3519759ba6988a2b73b5874b17c5958ac7d0aa48a8b1d84d66ef25fa345f1
78+ --build-arg GPROFILER_BUILDER=@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4
79+ --build-arg PYPERF_BUILDER_UBUNTU=@sha256:cf31af331f38d1d7158470e095b132acd126a7180a54f263d386da88eb681d93
80+ --build-arg DOTNET_BUILDER=@sha256:525ce79a6f545131df515ce34f7ee086eb18e4d707eff9676b2678f2f23b6d9e
81+ --build-arg NODE_PACKAGE_BUILDER_MUSL=@sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a
82+ --build-arg NODE_PACKAGE_BUILDER_GLIBC=centos/devtoolset-7-toolchain-centos7@sha256:24d4c230cb1fe8e68cefe068458f52f69a1915dd6f6c3ad18aa37c2b8fa3e4e1
83+ "
6984
7085 echo "Building py-spy (Rust Python profiler)..."
7186 docker buildx build -f executable.Dockerfile \
7287 --target pyspy-builder \
73- --build-arg PYSPY_RUST_BUILDER_VERSION=@sha256:541a1720c1cedddae9e17b4214075bf57c20bc7b176b4bba6bce3437c44d51ef \
88+ $BUILD_ARGS \
7489 -t "ghcr.io/${REPO_LOWER}/gprofiler-pyspy:latest" \
7590 --push \
7691 .
7792
7893 echo "Building rbspy (Rust Ruby profiler)..."
7994 docker buildx build -f executable.Dockerfile \
8095 --target rbspy-builder \
81- --build-arg RBSPY_RUST_BUILDER_VERSION=@sha256:65b63b7d003f7a492cc8e550a4830aaa1f4155b74387549a82985c8efb3d0e88 \
96+ $BUILD_ARGS \
8297 -t "ghcr.io/${REPO_LOWER}/gprofiler-rbspy:latest" \
8398 --push \
8499 .
85100
86101 echo "Building dotnet-trace..."
87102 docker buildx build -f executable.Dockerfile \
88103 --target dotnet-builder \
89- --build-arg DOTNET_BUILDER=@sha256:525ce79a6f545131df515ce34f7ee086eb18e4d707eff9676b2678f2f23b6d9e \
104+ $BUILD_ARGS \
90105 -t "ghcr.io/${REPO_LOWER}/gprofiler-dotnet:latest" \
91106 --push \
92107 .
93108
94109 echo "Building perf (Linux perf tool)..."
95110 docker buildx build -f executable.Dockerfile \
96111 --target perf-builder \
97- --build-arg PERF_BUILDER_UBUNTU=@sha256:dca176c9663a7ba4c1f0e710986f5a25e672842963d95b960191e2d9f7185ebe \
112+ $BUILD_ARGS \
98113 -t "ghcr.io/${REPO_LOWER}/gprofiler-perf:latest" \
99114 --push \
100115 .
101116
102117 echo "Building phpspy..."
103118 docker buildx build -f executable.Dockerfile \
104119 --target phpspy-builder \
105- --build-arg PHPSPY_BUILDER_UBUNTU=@sha256:cf31af331f38d1d7158470e095b132acd126a7180a54f263d386da88eb681d93 \
120+ $BUILD_ARGS \
106121 -t "ghcr.io/${REPO_LOWER}/gprofiler-phpspy:latest" \
107122 --push \
108123 .
109124
110125 echo "Building async-profiler (glibc)..."
111126 docker buildx build -f executable.Dockerfile \
112127 --target async-profiler-builder-glibc \
113- --build-arg AP_BUILDER_CENTOS=@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e \
128+ $BUILD_ARGS \
114129 -t "ghcr.io/${REPO_LOWER}/gprofiler-async-profiler-glibc:latest" \
115130 --push \
116131 .
117132
118133 echo "Building async-profiler CentOS test (glibc)..."
119134 docker buildx build -f executable.Dockerfile \
120135 --target async-profiler-centos-min-test-glibc \
121- --build-arg AP_BUILDER_CENTOS=@sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e \
122- --build-arg AP_CENTOS_MIN=:6 \
136+ $BUILD_ARGS \
123137 -t "ghcr.io/${REPO_LOWER}/gprofiler-async-profiler-glibc-tested:latest" \
124138 --push \
125139 .
126140
127141 echo "Building async-profiler (musl)..."
128142 docker buildx build -f executable.Dockerfile \
129143 --target async-profiler-builder-musl \
130- --build-arg AP_BUILDER_ALPINE=@sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a \
144+ $BUILD_ARGS \
131145 -t "ghcr.io/${REPO_LOWER}/gprofiler-async-profiler-musl:latest" \
132146 --push \
133147 .
134148
135149 echo "Building burn (Go tool)..."
136150 docker buildx build -f executable.Dockerfile \
137151 --target burn-builder \
138- --build-arg BURN_BUILDER_GOLANG=@sha256:f7d3519759ba6988a2b73b5874b17c5958ac7d0aa48a8b1d84d66ef25fa345f1 \
152+ $BUILD_ARGS \
139153 -t "ghcr.io/${REPO_LOWER}/gprofiler-burn:latest" \
140154 --push \
141155 .
142156
143157 echo "Building node package (musl)..."
144158 docker buildx build -f executable.Dockerfile \
145159 --target node-package-builder-musl \
146- --build-arg NODE_PACKAGE_BUILDER_MUSL=@sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a \
160+ $BUILD_ARGS \
147161 -t "ghcr.io/${REPO_LOWER}/gprofiler-node-musl:latest" \
148162 --push \
149163 .
150164
151165 echo "Building BCC/PyPerf..."
152166 docker buildx build -f executable.Dockerfile \
153167 --target bcc-build \
154- --build-arg PYPERF_BUILDER_UBUNTU=@sha256:cf31af331f38d1d7158470e095b132acd126a7180a54f263d386da88eb681d93 \
155- --build-arg PERF_BUILDER_UBUNTU=@sha256:dca176c9663a7ba4c1f0e710986f5a25e672842963d95b960191e2d9f7185ebe \
168+ $BUILD_ARGS \
156169 -t "ghcr.io/${REPO_LOWER}/gprofiler-bcc:latest" \
157170 --push \
158171 .
159172
160173 echo "Building node package (glibc)..."
161174 docker buildx build -f executable.Dockerfile \
162175 --target node-package-builder-glibc \
163- --build-arg NODE_PACKAGE_BUILDER_GLIBC=centos/devtoolset-7-toolchain-centos7@sha256:24d4c230cb1fe8e68cefe068458f52f69a1915dd6f6c3ad18aa37c2b8fa3e4e1 \
176+ $BUILD_ARGS \
164177 -t "ghcr.io/${REPO_LOWER}/gprofiler-node-glibc:latest" \
165178 --push \
166179 .
167180
168181 echo "Building Python 3.10 base..."
169182 docker buildx build -f executable.Dockerfile \
170183 --target build-prepare \
171- --build-arg GPROFILER_BUILDER=@sha256:be65f488b7764ad3638f236b7b515b3678369a5124c47b8d32916d6487418ea4 \
184+ $BUILD_ARGS \
172185 -t "ghcr.io/${REPO_LOWER}/gprofiler-python-base:latest" \
173186 --push \
174187 .
0 commit comments