Skip to content

Seeking Recommendations for Running MySQL Enterprise Edition (RPM/DEB) as a Docker Container #1084

@hackerup

Description

@hackerup

Hi,

I've recently received the RPM and DEB packages for MySQL Enterprise Edition and I'm planning to run it as a Docker container. Since I'm not using the standard MySQL Docker image, I want to build a custom Docker image from these packages.

Context:

  • Packages Available: I have both RPM and DEB packages for MySQL Enterprise Edition.
  • Objective: I want to create a Docker image from these packages and run MySQL as a container.

My Current Approach:

  1. Base Image: Considering using Oracle Linux or Ubuntu as the base image depending on the package type (RPM for Oracle Linux, DEB for Ubuntu).
  2. Installation: Planning to copy the RPM or DEB packages into the Docker build context and use yum or dpkg to install them during the Docker image build process.
  3. Configuration: Set up environment variables, directories, and permissions needed for MySQL to run properly within the container.

Example Dockerfile for RPM (Oracle Linux):

FROM oraclelinux:8

ENV MYSQL_USER=mysql \
    MYSQL_VERSION=<YOUR_MYSQL_VERSION> \
    MYSQL_DATA_DIR=/var/lib/mysql \
    MYSQL_RUN_DIR=/var/run/mysqld \
    MYSQL_LOG_DIR=/var/log/mysql

RUN yum install -y libaio

COPY ./rpms /tmp/mysql-rpms/
RUN yum localinstall -y /tmp/mysql-rpms/*.rpm && \
    rm -rf /tmp/mysql-rpms && \
    yum clean all

RUN mkdir -p $MYSQL_DATA_DIR $MYSQL_RUN_DIR $MYSQL_LOG_DIR && \
    chown -R $MYSQL_USER:$MYSQL_USER $MYSQL_DATA_DIR $MYSQL_RUN_DIR $MYSQL_LOG_DIR

EXPOSE 3306

CMD ["mysqld_safe"]

Request:

  • Best Practices: Could you advise on best practices for building and running MySQL Enterprise Edition from RPM/DEB packages in Docker?
  • Base Image Recommendation: Should I stick with Oracle Linux for RPM or Ubuntu for DEB, or is there a more appropriate base image?
  • Community Examples: Are there any examples or repositories where similar setups are used that I could reference?

Thank you for your guidance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions