- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3
 
feat: Add Docker image for pngcrush with optimized settings #505
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
base: main
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,10 @@ | |||
| FROM alpine:3.18 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why that version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unsure which version to use. Thought full semantic versions for base images are good for reproducibility. It makes more sense to use the latest image 3.22, right?!
| RUN apk update && \ | ||
| apk add --no-cache pngcrush \ | ||
| rm -rf /var/cache/apk/* | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need both --no-cache and update + rm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm removes any remaining package cache files from the /var/cache/apk directory. Even with --no-cache, some temporary files or metadata might persist, or if apk update was run, its fetched index files would be present. This rm command ensures a thorough cleanup, further reducing the final image size
        
          
                ferretdb-pngcrush/Dockerfile
              
                Outdated
          
        
      | WORKDIR /workdir | ||
| 
               | 
          ||
| ENTRYPOINT ["/usr/bin/pngcrush"] | ||
| CMD ["-ow", "-brute", "-reduce", "-rem", "allb"] No newline at end of file | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need allb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we really need this. It was an attempt to check every possible parameter to reduce file size or in this case remove all ancillary (non-essential) chunks/metadata.
This pull request introduces a new Dockerfile for pngcrush.
First step for FerretDB/FerretDB#4637
Issues
Improvements