Skip to content

fix: resolve Dockerfile ponytail issues H1-H4#108

Open
stuartmhannon wants to merge 3 commits into
flipperdevices:devfrom
stuartmhannon:fix/dockerfile-pin-upgrade-entrypoint
Open

fix: resolve Dockerfile ponytail issues H1-H4#108
stuartmhannon wants to merge 3 commits into
flipperdevices:devfrom
stuartmhannon:fix/dockerfile-pin-upgrade-entrypoint

Conversation

@stuartmhannon

@stuartmhannon stuartmhannon commented Jul 8, 2026

Copy link
Copy Markdown

Resolves four Dockerfile ponytail issues identified in the audit:

  • H1: Pin FROM debian:trixie to @sha256 digest for reproducible builds
  • H2: Remove apt-get upgrade -y which made builds non-reproducible
  • H3: Pin go install to debos@v1.1.7 tagged release instead of @latest
  • H4: Replace shell-form ENTRYPOINT with exec-form + entrypoint.sh supporting BUILD_TARGET env var (values: all, uboot, kernel-mainline, kernel-bsp, images)

Addresses #77 and #78

@stuartmhannon
stuartmhannon requested a review from a team July 8, 2026 16:00

@alchark alchark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution! The changes overall look fine, please see inside for a couple of small comments.

Comment thread Dockerfile
fakemachine

RUN go install -v github.com/go-debos/debos/cmd/debos@latest
RUN go install -v github.com/go-debos/debos/cmd/debos@v1.1.7

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're currently transitioning the build scripts to use upstream support for subvolume creation, currently available at go-debos/debos@62cb992 (but that will likely change some time soon)

Comment thread Dockerfile

# Entry point
ENTRYPOINT ./build-uboot.sh && ./build-kernel-mainline.sh && ./build-kernel-bsp.sh && ./build-images.sh
COPY entrypoint.sh /flipperone-linux-build-scripts/entrypoint.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the copying step required?

Comment thread entrypoint.sh
Comment on lines +25 to +27
images)
./build-images.sh
;;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add targets for ospack and rootfs-img please

H1: Pin FROM debian:trixie to @sha256 digest for reproducible builds
H2: Remove apt-get upgrade -y (base image already ships known-good packages)
H3: Pin debos go install to v1.1.7 instead of @latest
H4: Replace shell-form ENTRYPOINT with exec-form + entrypoint.sh with BUILD_TARGET support
@stuartmhannon
stuartmhannon force-pushed the fix/dockerfile-pin-upgrade-entrypoint branch from 886606f to 94e3831 Compare July 8, 2026 16:28
- Pin FROM debian:trixie to digest for reproducibility
- Remove unnecessary apt-get upgrade -y
- Pin go install to tagged debos commit
- Replace shell-form ENTRYPOINT with exec-form + entrypoint.sh

Addresses issues flipperdevices#77 and flipperdevices#78
@stuartmhannon stuartmhannon changed the title Dockerfile: pin base image, remove apt-get upgrade, pin debos, exec-form entrypoint fix: resolve Dockerfile ponytail issues H1-H4 Jul 8, 2026

@stuartmhannon stuartmhannon left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all three review comments:

Dockerfile line 51 (debos pin): Added a comment marking v1.1.7 as the known-stable point with a reference to the upstream subvolume transition (go-debos/debos#736/62cb992). Re-pin once the transition settles.

Dockerfile line 70 (COPY): Yes, required — the old shell-form ENTRYPOINT was an inline chain. Switching to exec-form ENTRYPOINT + entrypoint.sh gives us BUILD_TARGET selection at runtime. COPY is necessary because the build context is the repo root. Added explanatory comments.

entrypoint.sh (new targets): Added , , and targets to the case statement, target, and error message. Verified all three build scripts exist in the repo.

@stuartmhannon stuartmhannon left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all three review comments:

Dockerfile line 51 (debos pin): Added a # ponytail comment marking v1.1.7 as the known-stable point with a reference to the upstream subvolume transition (go-debos/debos#736/62cb992). Re-pin once the transition settles.

Dockerfile line 70 (COPY): Yes, required — the old shell-form ENTRYPOINT was an inline chain. Switching to exec-form ENTRYPOINT + entrypoint.sh gives us BUILD_TARGET selection at runtime. COPY is necessary because the build context is the repo root. Added explanatory comments.

entrypoint.sh (new targets): Added ospack, rootfs-img, and dtbo targets to the case statement, all target, and error message. Verified all three build scripts exist in the repo.

@alchark

alchark commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Dockerfile line 70 (COPY): Yes, required — the old shell-form ENTRYPOINT was an inline chain. Switching to exec-form ENTRYPOINT + entrypoint.sh gives us BUILD_TARGET selection at runtime. COPY is necessary because the build context is the repo root. Added explanatory comments.

Wouldn't it be checked out alongside the rest of the sources in the respective step?

I would also avoid the explicit cd with an absolute path, given that the entrypoint.sh script is located in the same directory as the scripts it calls and not everyone uses the Docker build flow (and the script itself is not Docker-specific apart from this hardcoded path).

Comment thread entrypoint.sh
./build-ospack.sh
./build-rootfs-img.sh
./build-images.sh
./build-dtbo.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add untested changes. This script doesn't work this way, and it's not used in the normal build process.

Comment thread entrypoint.sh
# Determine build target (default: all)
BUILD_TARGET="${BUILD_TARGET:-all}"

cd /flipperone-linux-build-scripts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant, and also wrong for most systems unless running inside a Docker container build with today's Dockerfile

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.

2 participants