Skip to content

Commit 8314509

Browse files
ipmbclaude
andcommitted
Remove legacy pack binary and heroku-20 pack selection logic
heroku-20 is EOL; the legacy pack v0.31.0 is no longer needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7568fbd commit 8314509

3 files changed

Lines changed: 6 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
* Builds using the `heroku-20` stack will now log a warning that the stack is end-of-life and should be upgraded to `heroku-24`
13+
* Removed support for `heroku-20` builds (previously required a legacy version of `pack`)
1314

1415
## [2.5.0] - 2025-10-21
1516

Dockerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
FROM golang:1.25-alpine AS builder
22
RUN apk add --no-cache curl
3-
# Install current `pack` and v0.31.0, the last pack version that supports heroku/buildpacks:20 builder
43
ENV PACK_VER=0.38.0
54
RUN set -ex && \
6-
mkdir -p /tmp/legacy-pack /tmp/current-pack && \
7-
cd /tmp/legacy-pack && \
8-
curl -sLO "https://github.com/buildpacks/pack/releases/download/v0.31.0/pack-v0.31.0-linux.tgz" && \
9-
tar xvzf "pack-v0.31.0-linux.tgz" && \
10-
cd /tmp/current-pack && \
5+
mkdir -p /tmp/pack && \
6+
cd /tmp/pack && \
117
curl -sLO "https://github.com/buildpacks/pack/releases/download/v$PACK_VER/pack-v$PACK_VER-linux.tgz" && \
128
tar xvzf "pack-v$PACK_VER-linux.tgz"
139

@@ -16,7 +12,6 @@ COPY ./builder .
1612
RUN go build -o /go/bin/apppack-builder main.go
1713

1814
FROM docker:27-dind
19-
COPY --from=builder /tmp/legacy-pack/pack /usr/local/bin/pack-legacy
20-
COPY --from=builder /tmp/current-pack/pack /usr/local/bin/pack
15+
COPY --from=builder /tmp/pack/pack /usr/local/bin/pack
2116
RUN apk add --no-cache git
2217
COPY --from=builder /go/bin/apppack-builder /usr/local/bin/apppack-builder

builder/build/build.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,7 @@ func (b *Build) buildWithDocker(config *containers.BuildConfig) error {
144144
func (b *Build) buildWithPack(config *containers.BuildConfig) error {
145145
b.Log().Debug().Msg("pack config registry-mirrors")
146146
builder := b.BuildpackBuilders()[0]
147-
packBinary := "pack"
148-
if builder == "heroku/buildpacks:20" {
149-
// use legacy pack for heroku/buildpacks:20
150-
packBinary = "pack-legacy"
151-
b.Log().Debug().Msg(fmt.Sprintf("using legacy pack version for %s", builder))
152-
}
153-
cmd := exec.Command(packBinary, "config", "registry-mirrors", "add", "index.docker.io", "--mirror", DockerHubMirror)
147+
cmd := exec.Command("pack", "config", "registry-mirrors", "add", "index.docker.io", "--mirror", DockerHubMirror)
154148
if err := cmd.Run(); err != nil {
155149
return err
156150
}
@@ -170,7 +164,7 @@ func (b *Build) buildWithPack(config *containers.BuildConfig) error {
170164
}
171165
packArgs = append(packArgs, config.Image)
172166
b.Log().Debug().Str("builder", builder).Str("buildpacks", buildpacks).Msg("building image")
173-
cmd = exec.Command(packBinary, packArgs...)
167+
cmd = exec.Command("pack", packArgs...)
174168
out := io.MultiWriter(os.Stdout, config.LogFile)
175169
cmd.Stdout = out
176170
cmd.Stderr = out

0 commit comments

Comments
 (0)