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

Optimize Dockerfile layers and improve readability #1651

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

Conversation

Madmaxs2
Copy link

@Madmaxs2 Madmaxs2 commented Dec 1, 2024

Changes in docker/deployer/Dockerfile:

Before:

image

After:

image

Improvements:

  1. Reduced Docker Layers

    • Combined multiple ENV commands into a single one
    • Fewer layers result in smaller image size and better performance
  2. Better Caching

    • Using --mount=type=cache for efficient caching of downloaded files
    • Faster subsequent builds by reusing cached content
  3. Atomic Operations

    • Related commands are grouped together
    • Ensures all installations either succeed completely or fail entirely
    • Prevents partial/incomplete states
  4. Enhanced Readability

    • Logically grouped PATH configurations
    • Cleaner and more maintainable code structure

These optimizations improve build efficiency, reduce image size, and enhance code maintainability without changing any functionality.

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.

1 participant