我正在docker上运行micronaut应用程序。如果我在本地机器上运行micronaut,比如 gradlew run
一切都很好。但是如果我建立了一个映像并用docker compose运行它,我会得到一个错误 Caused by: io.micronaut.context.exceptions.NoSuchBeanException: No bean of type [io.micronaut.security.oauth2.configuration.OauthClientConfiguration] exists for the given qualifier: @Named('fb'). Make sure the bean is not disabled by bean requirements (enable trace logging for 'io.micronaut.context.condition' to check) and if the bean is enabled then ensure the class is declared a bean and annotation processing is enabled (for Java and Kotlin the 'micronaut-inject-java' dependency should be configured as an annotation processor).
dockerfile文件:
WORKDIR /app
COPY . /app
RUN ./gradlew dockerBuild
RUN ./gradlew build -x test
FROM openjdk:14-alpine
COPY --from=build /app/build/libs/server-*-all.jar server.jar
EXPOSE 8080
CMD ["java", "-Dcom.sun.management.jmxremote", "-Xmx128m", "-jar", "server.jar"]
暂无答案!
目前还没有任何答案,快来回答吧!