首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Quarkus docker构建失败

Quarkus docker构建失败
EN

Stack Overflow用户
提问于 2020-11-08 18:17:55
回答 2查看 527关注 0票数 0

我们一直在尝试将quarkus构建映像部署到ECR,但最近遇到了问题

代码语言:javascript
复制
error: Error -1 running transaction
The command '/bin/sh -c microdnf install curl ca-certificates ${JAVA_PACKAGE}     && microdnf update     && microdnf clean all     && mkdir /deployments     && chown 1001 /deployments     && chmod "g+rwX" /deployments     && chown 1001:root /deployments     && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh     && chown 1001 /deployments/run-java.sh     && chmod 540 /deployments/run-java.sh     && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security' returned a non-zero code: 1

使用命令docker build -f /src/main/docker/dockerfile.jvmapp:-t。

这是docker文件

代码语言:javascript
复制
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1

ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
    && microdnf update \
    && microdnf clean all \
    && mkdir /deployments \
    && chown 1001 /deployments \
    && chmod "g+rwX" /deployments \
    && chown 1001:root /deployments \
    && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
    && chown 1001 /deployments/run-java.sh \
    && chmod 540 /deployments/run-java.sh \
    && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security

# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/app.jar

EXPOSE 8080
USER 1001

ENTRYPOINT [ "/deployments/run-java.sh" ]
EN

回答 2

Stack Overflow用户

发布于 2020-11-11 08:42:51

几天前,在一个没有更改任何配置的工作项目中遇到了同样的错误。只是开始失败了。在我这边,我在更新后设法解决了这个问题

代码语言:javascript
复制
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1

代码语言:javascript
复制
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3

在Dockerfile.jvm中

票数 0
EN

Stack Overflow用户

发布于 2020-11-12 14:55:43

@isolona的解决方案也适用于我们的项目。从基础镜像的超最小:8.1升级到超极小:8.3修复了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64736936

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档