我正在使用以下docker-compose.yml设置我的环境
version: "3"
services:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: example_db_user
MYSQL_PASSWORD: example_db_pass
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "3306:3306"
tomcat:
image: picoded/tomcat7
environment:
JDBC_URL: jdbc:mysql://db:3306/data-core?connectTimeout=0&socketTimeout=0&autoReconnect=true
JDBC_USER: example_db_user
JDBC_PASS: example_db_pass
container_name: tomcat7hope
ports:
- "8080:8080"
volumes:
- ./docker/data-core.war:/usr/local/tomcat/webapps/data-core.war
depends_on:
- db
maven:
build:
context: .
depends_on:
- tomcat
我的dockerfile是
FROM maven:3.5-jdk-8
RUN mvn clean install
在运行命令docker-compose up the maven容器后退出,提示构建失败,尚未为此构建指定目标。但是我已经在我的dockerfile中指定了RUN mvn clean install,为什么它不能正常运行? >