KSS
KSS

Reputation: 1071

GSSAPI Docker Installation Issue - /bin/sh: 1: krb5-config: not found

I successfully tried out GSSAPI to generate kerberos tickets in my Python app locally on my Mac. Now I am trying to package this as a Docker image.

When I try to build the image I keep getting this error:

------                                                                                                                                                                                                                                                      
 > [ 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

I am also running this before I call RUN pip install gssapi:

> RUN DEBIAN_FRONTEND=noninteractive apt install -y krb5-config krb5-user

The main issue I am trying to solve is this:

/bin/sh: 1: krb5-config: not found

Docker file:

FROM python:slim-buster

PYTHONDONTWRITEBYTECODE=1s

PYTHONUNBUFFERED=1

COPY requirements.txt . COPY *.py . RUN python -m pip install --upgrade pip RUN apt-get -qq update &&
apt-get -yqq install 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 -r requirements.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 add - RUN curl 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 install -y mssql-tools18 RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc

CMD ["python","main.py"]

What am I missing? I can't seem to find anything on this.

Upvotes: 1

Views: 7768

Answers (2)

For RHEL systems below steps helped me to fix /bin/sh: 1: krb5-config: not found error during the pip/pip3 install.

# yum --enablerepo=* install gcc python3-devel krb5-devel

Upvotes: 0

KSS
KSS

Reputation: 1071

Apparently, this is also required before gssapi is installed:

apt-get install libkrb5-dev -y

Upvotes: 4

Related Questions