我想在本地运行此docker hub映像:https://hub.docker.com/r/jhipster/jhipster-sample-app(通常在W10home中使用Docker ToolBox运行(正常运行),并且工作正常)
我按照以下说明进行了操作:https://www.jhipster.tech/docker-compose/ 并尝试运行: $ docker-compose -f jhipster-sample-app / prod.yml up ,但是它给了我这个错误(尽管有图像):
usuario@DESKTOP-GTCQCAR MINGW64 /c/Program Files/Docker Toolbox
$ docker-compose -f jhipster-sample-app/prod.yml up
ERROR: .FileNotFoundError: [Errno 2] No such file or directory: '.\\jhipster-sample-app/prod.yml'
注意:我也尝试更改标签,但结果相同。为什么没有找到可以确定的图像?
我还尝试快速启动:在开发配置文件中直接使用Docker直接运行一个简单的jhipster应用程序: $ docker container run -d -p 8080:8080 -e SPRING_PROFILES_ACTIVE = dev jhipster / jhipster-sample-app < / strong>
但是,我无法访问http://localhost:8080处的应用程序(尽管容器已创建并正在运行)。
我什至尝试运行它: $ docker run jhipster / jhipster-sample-app 出现此错误:
2019-01-31 09:33:05.215 INFO 1 --- [ main]
i.g.j.s.JhipsterSampleApplicationApp : Starting JhipsterSampleApplicationApp on 596e926cb096 with PID 1 (/app.war started by root in /)
2019-01-31 09:33:05.252 INFO 1 --- [ main] i.g.j.s.JhipsterSampleApplicationApp : The following profiles are active: prod
2019-01-31 09:33:37.773 ERROR 1 --- [ main] com.zaxxer.hikari.pool.HikariPool : Hikari - Exception during pool initialization.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
但是我可以运行其他图像,例如 $ docker run hello-world
所以我在这里感到迷茫,我不知道我在做什么错。谢谢大家!我是Docker的新手。
答案 0 :(得分:0)
要运行https://hub.docker.com/r/jhipster/jhipster-sample-app,则需要启动另一容器如数据库。这些未打包在应用容器中。
git clone https://github.com/jhipster/jhipster-sample-app.git
cd jhipster-sample-app
docker-compose -f src/main/docker/app.yml up -d
这将从app.yml加载配置,并启动应用程序和数据库容器。