From 418c9ffc7a73410a981c0ace2c08bc07f885dd5c Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 20 Oct 2020 19:36:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dockerfile b/dockerfile index 3d585900..7ed256b7 100644 --- a/dockerfile +++ b/dockerfile @@ -2,6 +2,18 @@ FROM java:8 VOLUME /tmp VOLUME /sop +COPY sop.sql sop.sql + +# 安装mysql +RUN yum install mysql mysql-server +RUN /etc/init.d/mysqld start &&\ +mysql -e "grant all privileges on *.* to 'root'@'%' identified by 'root';" &&\ +mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by 'root';" +EXPOSE 3306 +CMD ["mysqld_safe"] + +CMD mysql -uroot -proot mysql < sop.sql + # 将所有应用放到一个镜像当中 ADD sop-gateway/target/*.jar sop/sop-gateway/sop-gateway.jar ADD sop-admin/sop-admin-server/target/*.jar sop/sop-admin/sop-admin.jar