首页 > 解决方案 > 无法提取wildfly客户端文件ni docker

问题描述

我正在尝试在 docker 中为 wildfly 添加 keyCloak 子系统,如下所示,但文件无法解压缩,它给了我一个错误。我尝试了 tar 变体,但也没有成功。从浏览器转到 curl 中的 url 会下载文件,并且可以在我的本地机器(ubuntu 20.4)上提取它。我在 Dockerfile 中遗漏了什么吗?

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
  unzip:  cannot find zipfile directory in one of keycloak-oidc-wildfly-adapter- 
  15.0.2.zip or
  keycloak-oidc-wildfly-adapter-15.0.2.zip.zip, and cannot find keycloak-oidc- 
  wildfly-adapter-15.0.2.zip.ZIP, period.

Dockerfile 是:

FROM jboss/wildfly:25.0.0.Final

ENV KEYCLOAK_VERSION 15.0.2
ENV WILDFLY_HOME /opt/jboss/wildfly

WORKDIR $WILDFLY_HOME
RUN curl -f -O https://github.com/keycloak/keycloak/releases/download/15.0.2/keycloak-oidc-wildfly-adapter-15.0.2.zip \
&& unzip keycloak-oidc-wildfly-adapter-15.0.2.zip -d .
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
EXPOSE 8080
EXPOSE 9990

标签: dockerdockerfile

解决方案


我意识到 wget 工作得很好。我将 curl 选项更改为 -LO 并且它有效。这是一个多部分文件。


推荐阅读