-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (54 loc) · 2.61 KB
/
Dockerfile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
######################################################
# ImageName : mariadb-connect
# Description : MariaDB DataBase with Connect Engine.
# Platform : amd64
# Author : Seele.Clover
# Copyright (c) 2024 by GDMU-NA, All Rights Reserved.
######################################################
# Get version from build-arg
ARG MARIADB_VERSION
######################################################
# downloader
######################################################
FROM ubuntu:latest as downloader
ARG MARIADB_VERSION=${MARIADB_VERSION}
WORKDIR /downloads
# Step 1: Download wrappers files and jdbc files
RUN apt-get update \
&& apt-get install -y wget \
&& wget https://archive.mariadb.org/mariadb-${MARIADB_VERSION}/bintar-linux-systemd-x86_64/mariadb-${MARIADB_VERSION}-linux-systemd-x86_64.tar.gz \
&& tar -zxvf mariadb-${MARIADB_VERSION}-linux-systemd-x86_64.tar.gz \
&& mkdir -p /downloads/wrapper \
&& cp -a mariadb-${MARIADB_VERSION}-linux-systemd-x86_64/share/JavaWrappers.jar /downloads/wrapper/ \
&& cp -a mariadb-${MARIADB_VERSION}-linux-systemd-x86_64/share/JdbcInterface.jar /downloads/wrapper/ \
&& wget https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc11.jar \
&& mkdir -p /downloads/jdbc \
&& mv ojdbc11.jar /downloads/jdbc/
######################################################
# mariadb
######################################################
FROM mariadb:${MARIADB_VERSION} as mariadb
ARG MARIADB_VERSION=${MARIADB_VERSION}
LABEL org.opencontainers.image.name="mariadb-connect" \
org.opencontainers.image.description="MariaDB DataBase with Connect Engine." \
org.opencontainers.image.version=${MARIADB_VERSION} \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.maintainer="Seele.Clover" \
org.opencontainers.image.vendor="GDMU-NA" \
org.opencontainers.image.repository="https://github.com/gdmuna/mariadb-connect" \
org.opencontainers.image.url="https://hub.docker.com/r/gdmuna/mariadb-connect"
EXPOSE 3306
ENV LANG=C.UTF-8 \
TZ=Asia/Shanghai \
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
# Step 2: Install connect engine plugin and openjdk
RUN apt-get update \
&& apt-get install -y --no-install-recommends mariadb-plugin-connect libodbc1 \
&& apt-get install -y --no-install-recommends openjdk-11-jdk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Step 3: Copy wrapper files and jdbc files
COPY --from=downloader /downloads/wrapper/* /usr/share/mysql/
COPY --from=downloader /downloads/jdbc/* /usr/lib/jvm/java-11-openjdk-amd64/lib/
# Step 4: Copy configuration file
COPY my.cnf /etc/mysql/conf.d/