我成功尝试使用 GSSAPI 在 Mac 本地的 Python 应用程序中生成 kerberos 票证。 现在我正在尝试将其打包为 Docker 映像。
当我尝试构建图像时,我不断收到此错误:
------
> [ 6/13] RUN pip install gssapi:
#10 1.307 Collecting gssapi
#10 1.383 Downloading gssapi-1.8.2.tar.gz (94 kB)
#10 1.400 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94.3/94.3 kB 6.3 MB/s eta 0:00:00
#10 1.427 Installing build dependencies: started
#10 4.102 Installing build dependencies: finished with status 'done'
#10 4.103 Getting requirements to build wheel: started
#10 4.548 Getting requirements to build wheel: finished with status 'error'
#10 4.552 error: subprocess-exited-with-error
#10 4.552
#10 4.552 × Getting requirements to build wheel did not run successfully.
#10 4.552 │ exit code: 1
#10 4.552 ╰─> [25 lines of output]
#10 4.552 /bin/sh: 1: krb5-config: not found
#10 4.552 Traceback (most recent call last):
#10 4.552 File "/usr/local/lib/python3.11/si
我也在调用 RUN pip install gssapi 之前运行这个:
> RUN DEBIAN_FRONTEND=noninteractive apt install -y krb5-config krb5-user
我要解决的主要问题是:
/bin/sh: 1: krb5-config: not found
Docker 文件:
来自 python:slim-buster
PYTHON不写字节码=1s
Python无缓冲=1
复制requirements.txt。复制 *.py 。运行 python -m pip install --upgrade pip 运行 apt-get -qq update &&
apt-get -yqq 安装 krb5-user libpam-krb5 &&
apt-get -yqq clean \ RUN DEBIAN_FRONTEND=noninteractive apt install -y krb5-config krb5-user RUN pip install gssapi RUN python -m pip install -rrequirements.txt RUN apt update -y && apt install g++ -y && apt install build-essential -y && apt install unixodbc-dev -y RUN apt install -y libgssapi-krb5-2 && apt install curl -y RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key 添加 - 运行 卷曲 https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list RUN apt update -y && ACCEPT_EULA=Y apt-get install -y msodbcsql18 && ACCEPT_EULA=Y apt-get 安装-y mssql-tools18 RUN echo '导出 PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrcCMD [“python”,“main.py”]
我错过了什么? 我似乎找不到任何关于此的信息。
显然,在安装gssapi之前也需要这样做:
apt-get 安装 libkrb5-dev -y
对于 RHEL 系统,以下步骤帮助我修复了
/bin/sh: 1: krb5-config: not found
错误。
# yum --enablerepo=* install gcc python3-devel krb5-devel