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: add mysql-client package #219

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

Monska85
Copy link
Contributor

@Monska85 Monska85 commented Sep 12, 2024

PR Type

Enhancement


Description

  • Added the mysql-client package to the Docker image
  • This enhancement allows for MySQL database operations directly from the container
  • The change is made in the RUN instruction of the Dockerfile
  • Other existing package installations and configurations remain unchanged

Changes walkthrough 📝

Relevant files
Enhancement
Dockerfile
Add MySQL client to Docker image                                                 

Dockerfile

  • Added mysql-client package to the list of installed packages using apk
    add
  • +1/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @sparkfabrik-ai-bot
    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Package Order
    The mysql-client package is added in the middle of the existing package list. Consider moving it to the end for better readability and easier future modifications.

    @sparkfabrik-ai-bot
    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Use multi-stage build to reduce the final image size

    Consider using a multi-stage build to reduce the final image size. Install build
    dependencies in a separate stage and copy only the necessary files to the final
    stage.

    Dockerfile [20]

    -RUN apk add --no-cache py-pip python3-dev curl make mysql-client gettext bash openssl libffi-dev openssl-dev gcc libc-dev jq yq rust cargo bat rsync yamllint util-linux && \
    +FROM alpine:3.14 AS builder
    +RUN apk add --no-cache py-pip python3-dev curl make mysql-client gettext bash openssl libffi-dev openssl-dev gcc libc-dev jq yq rust cargo bat rsync yamllint util-linux
     
    +FROM alpine:3.14
    +COPY --from=builder /usr/bin/mysql /usr/bin/mysql
    +COPY --from=builder /usr/lib/libmysqlclient.so* /usr/lib/
    +RUN apk add --no-cache py-pip python3 curl make gettext bash openssl jq yq bat rsync yamllint util-linux && \
    +
    Suggestion importance[1-10]: 8

    Why: Multi-stage builds can significantly reduce the final image size by separating build dependencies from runtime dependencies, which is crucial for container optimization.

    8
    Maintainability
    Pin package versions for reproducible builds

    Consider pinning the version of mysql-client to ensure reproducible builds and avoid
    potential issues with future updates.

    Dockerfile [20]

    -RUN apk add --no-cache py-pip python3-dev curl make mysql-client gettext bash openssl libffi-dev openssl-dev gcc libc-dev jq yq rust cargo bat rsync yamllint util-linux && \
    +RUN apk add --no-cache py-pip python3-dev curl make mysql-client=10.5.12-r0 gettext bash openssl libffi-dev openssl-dev gcc libc-dev jq yq rust cargo bat rsync yamllint util-linux && \
     
    Suggestion importance[1-10]: 7

    Why: Pinning package versions ensures reproducibility and stability across different environments, which is important for maintaining consistent builds.

    7
    Enhancement
    Group related packages for improved readability

    Consider grouping related packages together in the apk add command to improve
    readability and maintainability of the Dockerfile.

    Dockerfile [20]

    -RUN apk add --no-cache py-pip python3-dev curl make mysql-client gettext bash openssl libffi-dev openssl-dev gcc libc-dev jq yq rust cargo bat rsync yamllint util-linux && \
    +RUN apk add --no-cache \
    +    # Python packages
    +    py-pip python3-dev \
    +    # Build tools
    +    curl make gcc libc-dev \
    +    # Database tools
    +    mysql-client \
    +    # Utility packages
    +    gettext bash openssl libffi-dev openssl-dev jq yq rust cargo bat rsync yamllint util-linux && \
     
    Suggestion importance[1-10]: 5

    Why: Grouping related packages improves code readability and maintainability, making it easier for developers to understand and modify the Dockerfile in the future.

    5

    @Monska85 Monska85 force-pushed the feat/add_mysql_client branch from 4636051 to ae33bfa Compare September 12, 2024 22:46
    Copy link
    Member

    @paolomainardi paolomainardi left a comment

    Choose a reason for hiding this comment

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

    LGTM

    @paolomainardi paolomainardi merged commit c95f32f into master Sep 12, 2024
    2 checks passed
    @paolomainardi paolomainardi deleted the feat/add_mysql_client branch September 12, 2024 23:26
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants