【发布时间】:2018-04-19 06:21:21
【问题描述】:
我正在尝试执行以下命令。
docker run --name artifactory-host-mysql -e DB_TYPE=mysql -e DB_HOST=my_host_ip -e DB_URL='jdbc:mysql://my_host_ip:3306/some_db?characterEncoding=UTF-8&elideSetAutoCommits=true' -e DB_PORT=3306 -e DB_USER=my_db_user -e DB_PASSWORD=my_passowrd -d -p 8083:8083 --net=host -v /artifactory/mysql-connector-java-5.1.46.jar:/opt/jfrog/artifactory/tomcat/lib/mysql-connector-java-5.1.46.jar artifactory-hostmysql
输出如下
Preparing to run Artifactory in Docker
=====================================
2018-04-19 05:32:46 [44 entrypoint-artifactory.sh] Dockerfile for this image can found inside the container.
2018-04-19 05:32:46 [282 entrypoint-artifactory.sh] Checking DB_TYPE
2018-04-19 05:32:46 [285 entrypoint-artifactory.sh] DB_TYPE is set to mysql
2018-04-19 05:32:46 [213 entrypoint-artifactory.sh] DB_HOST is set to my_ip
2018-04-19 05:32:46 [215 entrypoint-artifactory.sh] Checking if need to copy mysql configuration
2018-04-19 05:32:46 [231 entrypoint-artifactory.sh] Copying mysql configuration...
2018-04-19 05:32:46 [239 entrypoint-artifactory.sh] Setting DB_URL to jdbc:mysql://my_ip:3306/some_db?characterEncoding=UTF-8&elideSetAutoCommits=true
2018-04-19 05:32:46 [243 entrypoint-artifactory.sh] Setting DB_USER to artifactory
2018-04-19 05:32:46 [247 entrypoint-artifactory.sh] Setting DB_PASSWORD to **********
2018-04-19 05:32:46 [251 entrypoint-artifactory.sh] Setting DB_PORT to 3306
2018-04-19 05:32:46 [266 entrypoint-artifactory.sh] Setting DB_HOST to my_ip
2018-04-19 05:32:46 [190 entrypoint-artifactory.sh] Waiting for DB mysql to be ready on my_ip/3306 within 30 seconds
2018-04-19 05:32:46 [198 entrypoint-artifactory.sh] .
2018-04-19 05:33:16 [198 entrypoint-artifactory.sh] .
2018-04-19 05:33:17 [34 entrypoint-artifactory.sh] ERROR: DB mysql failed to start in the given time
mysql 服务已经在主机中运行 端口 3306 也为 tcp 开放 - netstat -tlnp 的输出低于
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
【问题讨论】:
-
Do I need to open the...不要让我们悬而未决! -
@TimBiegeleisen 实际上正在考虑通过 iptables 打开 3306,但随后端口再次从 netstat 命令输出为 tcp 协议打开
标签: mysql docker artifactory