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

Add Docker pipeline #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IlyaVassyutovich
Copy link

Add proper1 pipeline to build and push a lightweight (based on Alpine) Docker image with imapfilter; I expect it to replase this drastically outdated image at DockerHub.

1 — free and open, with easily verifiable source code.

Copy link

@mh166 mh166 left a comment

Choose a reason for hiding this comment

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

I can't review the GitHub actions part as I'm not familiar with it. At least, it looks plausible. 😅 However, I want to recommend some minor tweaks to the Dockerfile to minimize the resulting image layers.

The same optimization could, in theory, be made for the build image. However, since this is just an ephemeral image, it really doesn't matter and therefore I left it out.



# Clean-up dist
RUN rm -rf /dist
Copy link

Choose a reason for hiding this comment

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

Again, this should be combined into one RUN command instead to reduce overhead:

RUN make install && rm -rf /dist

Copy link

@mh166 mh166 left a comment

Choose a reason for hiding this comment

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

Edit: Sorry for the spam. 🙈 I messed up the previous review... This is the same issue as mentioned above...


## Install shared dependencies
RUN apk update
RUN apk add --no-cache openssl
Copy link

Choose a reason for hiding this comment

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

It is good practice to combine the RUN commands into on single command in order to not create unnecessary layers in the final images. As the shared image is also being used by the final image, it would make sense to combine them:

RUN apk add --no-cache openssl make lua5.1 pcre2

Also, apk update is not needed here: when called with the --no-cache option, apk add does not make use of any locally cached information (as provided by apk update) but instead fetches all required data from the repo. 😊

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