11
31
Fork
You've already forked silverfish
19

WIP: feat: simple alpine Dockerfile #151

Draft
jalil wants to merge 1 commit from jalil/silverfish:jalil/simple-alpine-image into main
pull from: jalil/silverfish:jalil/simple-alpine-image
merge into: conjured:main
conjured:main
conjured:zkat/products
conjured:150_musl_build
conjured:zkat/scaffolder
Contributor
Copy link

Add a simple alpine dockerfile using cargo-chef to build
silverfish-stall images.

The image comes out at 32.5 MiB. This is not thought as a "production"
image, but just as a base image from which to build a production image.

I would like this to be pushed as a package as part of the release, in addition to the release binaries.

We could then have a silverfish-contrib folder or repo with a fly.dockerfile that consumes this image and is ready to use with fly.io or similar providers.

Add a simple `alpine` dockerfile using `cargo-chef` to build silverfish-stall images. The image comes out at 32.5 MiB. This is not thought as a "production" image, but just as a base image from which to build a production image. I would like this to be pushed as a package as part of the release, in addition to the release binaries. We could then have a `silverfish-contrib` folder or repo with a `fly.dockerfile` that consumes this image and is ready to use with fly.io or similar providers.
feat: simple alpine Dockerfile
All checks were successful
CI Silverfish Stall / silverfish-stall-amd64 (pull_request) Successful in 3m25s
3e64bb225f
Add a simple `alpine` dockerfile using `cargo-chef` to build
silverfish-stall images.
The image comes out at 32.5 MiB. This is not thought as a "production"
image, but just as a base image from which to build a production image.
Signed-off-by: Jalil David Salamé Messina <jalil.salame@gmail.com>
zkat changed title from (削除) Draft: feat: simple alpine Dockerfile (削除ここまで) to WIP: Draft: feat: simple alpine Dockerfile 2025年11月09日 17:24:20 +01:00
jalil changed title from (削除) WIP: Draft: feat: simple alpine Dockerfile (削除ここまで) to WIP: feat: simple alpine Dockerfile 2025年11月10日 22:07:26 +01:00

I generally don't like having significantly different build toolchains for deploy as compared to the build toolchain for test. could you explain a bit what we gain here by using cargo chef instead of just running a normal build?

I generally don't like having significantly different build toolchains for deploy as compared to the build toolchain for test. could you explain a bit what we gain here by using cargo chef instead of just running a normal build?
@ -0,0 +16,4 @@
RUN cargo build --release
# We no longer need the build dependencies
FROM alpine:3.22.2 AS runtime
Owner
Copy link

this is good, using a smaller image for runtime here.

this is good, using a smaller image for runtime here.
Author
Contributor
Copy link

@cjdesno wrote in #151 (comment):

I generally don't like having significantly different build toolchains for deploy as compared to the build toolchain for test. could you explain a bit what we gain here by using cargo chef instead of just running a normal build?

If you have docker caching setup, then cargo-chef lets you cache the layers more effectively, basically, cargo chef cook only runs if the dependencies change.

Then again, this isn't necessary, so we could just remove it and do a clean build every time.

@cjdesno wrote in https://codeberg.org/conjured/silverfish/pulls/151#issuecomment-8712156: > I generally don't like having significantly different build toolchains for deploy as compared to the build toolchain for test. could you explain a bit what we gain here by using cargo chef instead of just running a normal build? If you have docker caching setup, then `cargo-chef` lets you cache the layers more effectively, basically, `cargo chef cook` only runs if the dependencies change. Then again, this isn't necessary, so we could just remove it and do a clean build every time.

i see, yeah i'd rather we just do a clean build here then.

i see, yeah i'd rather we just do a clean build here then.

if we want to push this image as part of the release, i wonder if it would make more sense to just build for musl in the release job (WIP: #161 ) and then pull the binary into this image, vs building both here and there. i'm open to either approach, haven't looked into what's standard for this.

if we want to push this image as part of the release, i wonder if it would make more sense to just build for musl in the release job (WIP: https://codeberg.org/conjured/silverfish/pulls/161 ) and then pull the binary into this image, vs building both here and there. i'm open to either approach, haven't looked into what's standard for this.
All checks were successful
CI Silverfish Stall / silverfish-stall-amd64 (pull_request) Successful in 3m25s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u jalil/simple-alpine-image:jalil-jalil/simple-alpine-image
git switch jalil-jalil/simple-alpine-image

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff jalil-jalil/simple-alpine-image
git switch jalil-jalil/simple-alpine-image
git rebase main
git switch main
git merge --ff-only jalil-jalil/simple-alpine-image
git switch jalil-jalil/simple-alpine-image
git rebase main
git switch main
git merge --no-ff jalil-jalil/simple-alpine-image
git switch main
git merge --squash jalil-jalil/simple-alpine-image
git switch main
git merge --ff-only jalil-jalil/simple-alpine-image
git switch main
git merge jalil-jalil/simple-alpine-image
git push origin main
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Compat
Breaking
Breaking change that won't be backward compatible
Flag/Good First Issue
Good issue for first-time contributors
Kind/Accessibility
Accessibility issue, bug or otherwise
Kind/Appearance
Design, styling, and other aesthetic and visual items
Kind/Bug
Something is not working
Kind/Compliance
Legal, policy, or some other kind of compliance
Kind/DevOps
CI/CD, releases, etc
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Performance
Gotta go fast
Kind/Security
This is security issue
Kind/Technical Improvement
Underlying technical improvement that is not necessarily user-impacting or visible.
Kind/Testing
Issue or pull request related to testing
Kind/UX
Related to user experience/product
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Size
L
Significant change
Size
M
Medium-size change
Size
S
Small change
Size
XL
Very large change that might take months to complete and impact many components
Size
XS
Trivially small change
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Status
Needs Design
Requires design/review from Alchemists (product/UX)
Status
Needs Discussion
A discussion needs to happen before implementation
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
conjured/silverfish!151
Reference in a new issue
conjured/silverfish
No description provided.
Delete branch "jalil/silverfish:jalil/simple-alpine-image"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?