Skip to content

DIY Dockerfile.repo not honoring cargo locks results in non-deterministic builds#8983

Closed
theJC wants to merge 3 commits intoapollographql:devfrom
theJC:fix/DockerfileNeedsToBeLocked
Closed

DIY Dockerfile.repo not honoring cargo locks results in non-deterministic builds#8983
theJC wants to merge 3 commits intoapollographql:devfrom
theJC:fix/DockerfileNeedsToBeLocked

Conversation

@theJC
Copy link
Copy Markdown
Contributor

@theJC theJC commented Mar 7, 2026

DIY Dockerfile.repo is not honoring cargo locks results in non-deterministic builds

I used it and ended up with a binary that had newer version of the h2 library than the official build, this change will fix the problem.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Mar 7, 2026

✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@theJC theJC changed the title DIY Dockerfile.repo missing --locked on cargo install, resulting in indeterministic build results DIY Dockerfile.repo not honoring cargo locks results in indeterministic builds Mar 7, 2026
# Build and install the router
RUN cargo install --path apollo-router
# Build the router
RUN cargo build --release -p apollo-router
Copy link
Copy Markdown
Contributor Author

@theJC theJC Mar 7, 2026

Choose a reason for hiding this comment

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

This is what the ci build uses, lets use this which honors the lockfile and so the DIY more closely aligns to the ci build.

COPY . .

# Build and install the router
RUN cargo install --path apollo-router
Copy link
Copy Markdown
Contributor Author

@theJC theJC Mar 7, 2026

Choose a reason for hiding this comment

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

because this didnt have --locked it was not honoring the cargo lock, and builds of an identical hash could end up with a different version of libraries.

RUN mkdir -p /dist/config && \
mkdir /dist/schema && \
mv /usr/local/cargo/bin/router /dist
mv target/release/router /dist
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

since we are building and not installing now

@theJC theJC changed the title DIY Dockerfile.repo not honoring cargo locks results in indeterministic builds DIY Dockerfile.repo not honoring cargo locks results in non-deterministic builds Mar 7, 2026
@abernix
Copy link
Copy Markdown
Member

abernix commented Mar 9, 2026

@mergify copy dev

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 9, 2026

copy dev

✅ Pull request copies have been created

Details

@abernix
Copy link
Copy Markdown
Member

abernix commented Mar 9, 2026

Nice fine. We really need to fix the contributor PR path. I'll get this over the line, again, for now, but making the copy at #8988 so I can fast-track it.

abernix added a commit that referenced this pull request Mar 10, 2026
…stic builds (copy #8983) (#8988)

Co-authored-by: Jon Christiansen <467023+theJC@users.noreply.github.com>
Co-authored-by: Jesse Rosenberger <git@jro.cc>
@abernix
Copy link
Copy Markdown
Member

abernix commented Mar 10, 2026

#8988 has landed. thanks!

@abernix abernix closed this Mar 10, 2026
smyrick pushed a commit that referenced this pull request Mar 17, 2026
…stic builds (copy #8983) (#8988)

Co-authored-by: Jon Christiansen <467023+theJC@users.noreply.github.com>
Co-authored-by: Jesse Rosenberger <git@jro.cc>
smyrick pushed a commit that referenced this pull request Mar 20, 2026
…stic builds (copy #8983) (#8988)

Co-authored-by: Jon Christiansen <467023+theJC@users.noreply.github.com>
Co-authored-by: Jesse Rosenberger <git@jro.cc>
@abernix abernix mentioned this pull request Mar 31, 2026
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