-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.ubi8
More file actions
54 lines (44 loc) · 1.92 KB
/
Dockerfile.ubi8
File metadata and controls
54 lines (44 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4-200
ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.28
ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.28
ENV MYSQL_USER=${MYSQL_USER}
ENV MYSQL_PASSWORD=${MYSQL_PASSWORD}
ENV MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
ENV DATADIR=/var/lib/mysql/data
ENV MYSQL_ROOT_HOST=%
# Setup repositories for minimal packages (all versions)
RUN rpm -U https://repo.mysql.com/mysql-community-minimal-release-el8.rpm \
&& rpm -U https://repo.mysql.com/mysql80-community-release-el8.rpm
# Install server and shell 8.0
RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \
&& microdnf install -y $MYSQL_SHELL_PACKAGE \
&& microdnf install -y --disablerepo=ubi-8-appstream \
--enablerepo=mysql80-server-minimal $MYSQL_SERVER_PACKAGE \
&& microdnf clean all \
&& mkdir /docker-entrypoint-initdb.d
COPY prepare-image.sh /
RUN chmod u+x /prepare-image.sh \
&& /prepare-image.sh && rm -f /prepare-image.sh
ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock
COPY docker-entrypoint.sh /entrypoint.sh
COPY healthcheck.sh /healthcheck.sh
RUN chmod u+x /entrypoint.sh \
&& chmod u+x /healthcheck.sh
ENTRYPOINT ["/entrypoint.sh"]
HEALTHCHECK CMD /healthcheck.sh
EXPOSE 3306 33060 33061
CMD ["mysqld"]