Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CI job for building Docker binary-only images #122

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Wirone
Copy link

@Wirone Wirone commented Nov 21, 2024

Similar to composer/docker#250 (more info), this PR introduces a CI process for releasing binary-only images for Pie 🥳!

You can see the result here, there is an image in my fork's Package Registry, built here.

Here's how the image looks like (dive ghcr.io/wirone/php-pie:latest):
image

PS: I decided to not verify GPG signature during build because we can trust our own workflow (we copy PHAR file built in previous stage), but also I had some problems with verification (GPG imported correctly, but verification failed). Users may verify the file on their own, if they want, using attached pie.asc.

.github/workflows/release.yml Show resolved Hide resolved
docs/usage.md Outdated Show resolved Hide resolved
docs/usage.md Outdated Show resolved Hide resolved
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a way we can build this architecture-agnostic (rather than explicitly building for arm64/amd64/etc) 🤔

Copy link
Author

Choose a reason for hiding this comment

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

As pointed out here, we can't do it (or at least I don't know how). Is it a problem, though?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was hoping you could build for noarch architecture or something to indicate that a single manifest can operate on any platform, since the only content of the image (the PHAR) is entirely platform agnostic. Not a major problem, but it creates overhead for something that should otherwise be a single step >.<

Copy link
Author

Choose a reason for hiding this comment

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

Sadly, I believe it's not possible.

@asgrim asgrim added the enhancement New feature or request label Nov 21, 2024
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
docs/usage.md Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Copy link
Author

Choose a reason for hiding this comment

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

FYI: this is currently not much usable for local development, but if you plan to define Docker setup for working with the project, you just need to utilise multi-stage build (keep standalone-binary target for releases and add new one(s) for development).

@asgrim asgrim added the maintainer feedback needed Needs details or feedback to be added by maintainers label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintainer feedback needed Needs details or feedback to be added by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants