-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
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:
- Base Image: Considering using Oracle Linux or Ubuntu as the base image depending on the package type (RPM for Oracle Linux, DEB for Ubuntu).
- Installation: Planning to copy the RPM or DEB packages into the Docker build context and use
yum
ordpkg
to install them during the Docker image build process. - 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
Labels
No labels