docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.46k stars 2.19k forks source link

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

Closed hackerup closed 3 weeks ago

hackerup commented 3 weeks ago

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:

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:

Thank you for your guidance!

tianon commented 3 weeks ago

Unfortunately, we only deal with the community/open source edition and have no experience with the enterprise edition -- I would suggest contacting your support reps at Oracle to see what they recommend.