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

ci: improve dockerfiles and build in ci #24

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

gs-anssi
Copy link
Contributor

📝 Description

Hello 👋

This PR corrects an issue with the repository's Dockerfiles: the final images don't include the glibc dependency due to them using the slim variant of the debian image as the base.
The consequence of this is that the lidis/r binaries crash on startup when running the docker images built from this repository's Dockerfiles, moreover no docker image is published on the docker hub.

Note that it might be desirable to squash the commits when merging, the commit history is ok, but not ideal

✔️ Changelog

The PR addresses this by:

  • rewriting the Dockerfiles into a single multi-stage Dockerfile (one stage for the send binary, another for the receive binary)
  • using one of Google's "distroless" docker image as the base for the final images.
  • switching to a non-root user for the final docker images
  • adding a CI job for building, tagging and publishing the final two docker images (send/receive) to the dockerhub

🥼 Tests

Note that I have tested the Github action logic for build, tagging and pushing the docker images but in my own fork (since I don't have access to this repo's CI). During my tests (which consisted of building and uploading the image's to my repo's github registry) everything worked as exepcted.

* fix: glibc in final docker images

* fix: pin rust image to major version based on debian

* fix: adjust compose file for new Dockerfile

* ci: public docker image on  repo tag

* ci: test pushing to own repo

* ci: fix

* ci: change image name

* ci: fix image name again

* ci: switch to upstream repo config

* refactor: ARG for final base image

* fix: switch to nonroot docker image
@gs-anssi gs-anssi self-assigned this Jan 10, 2025
@gs-anssi gs-anssi changed the base branch from master to dev January 10, 2025 13:14
@r3dlight r3dlight self-requested a review January 10, 2025 13:16
@r3dlight r3dlight marked this pull request as ready for review January 10, 2025 13:17
Copy link
Contributor

@r3dlight r3dlight left a comment

Choose a reason for hiding this comment

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

Approved.

@r3dlight r3dlight merged commit dd89d65 into dev Jan 10, 2025
2 checks passed
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