Replies: 1 comment
-
资源1. Dockerfile 模版(Dockerfile)FROM centos:7
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN yum install -y which
COPY ./sqle.rpm /opt/sqle.rpm
COPY ./start.sh /opt/
RUN rpm -ivh /opt/sqle.rpm --prefix=/opt/sqle
RUN rm -f /opt/sqle.rpm
RUN mkdir -p /opt/sqle/plugins
RUN chown actiontech-universe:actiontech /opt/sqle/plugins
RUN chown actiontech-universe:actiontech /opt/start.sh
RUN chmod +x /opt/start.sh
ENV MYSQL_HOST ""
ENV MYSQL_PORT 3306
ENV MYSQL_USER ""
ENV MYSQL_PASSWORD ""
ENV MYSQL_SCHEMA ""
ENV DEBUG false
ENV AUTO_MIGRATE_TABLE true
USER actiontech-universe
WORKDIR /opt
CMD ["sh", "-c", "/opt/start.sh"] 2. 启动脚本(start.sh)#!/bin/bash
SQLE_BASE="/opt/sqle"
SQLE_CONF="${SQLE_BASE}/etc/sqled.yml"
if [ ! -f "${SQLE_CONF}" ];then
cat > ${SQLE_CONF} <<EOF
server:
sqle_config:
server_port: 10000
auto_migrate_table: ${AUTO_MIGRATE_TABLE}
debug_log: ${DEBUG}
log_path: '${SQLE_BASE}/logs'
plugin_path: '${SQLE_BASE}/plugins'
db_config:
mysql_cnf:
mysql_host: '${MYSQL_HOST}'
mysql_port: ${MYSQL_PORT}
mysql_user: '${MYSQL_USER}'
mysql_password: '${MYSQL_PASSWORD}'
mysql_schema: '${MYSQL_SCHEMA}'
EOF
fi
echo "start sqle server..."
cd ${SQLE_BASE}
./bin/sqled --config ${SQLE_CONF} 3. 下载对应的SQLE RPM包略 步骤
... Dockerfile
... sqle.rpm
... start.sh
docker build -t {镜像名} -f ./Dockerfile .
例:docker build -t actiontech/sqle-ce:latest -f ./Dockerfile . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
如何制作SQLE的docker镜像
Beta Was this translation helpful? Give feedback.
All reactions