Tag: docker maven antrun plugin

如何使docker失败或检查版本存在

我有maven运行bash来与Docker构build一些东西。 <plugin> … <artifactId>maven-antrun-plugin</artifactId> … <exec executable="${basedir}/generate.sh" failonerror="true"> <arg value="${thrift.version}" /> … bash脚本运行如下所示: for file in src/main/thrift/*.thrift; do echo "Compiling ${file}" docker run {…} thrift:${THRIFT_VERSION} thrift {…} done 我的问题是,当Docker无法find我请求的版本时,它在控制台中显示错误,但它不会“失败”:它只是不断的build立。 [exec] Compiling src/main/thrift/amsException.thrift [exec] docker: Tag 0.9.0 not found in repository docker.io/library/thrift. [exec] See 'docker run –help'. [exec] Unable to find image 'thrift:0.9.0' locally 因此maven说 [INFO] […]