Error creating docker image with msodbcsql

Un saludo para todos, actualmente me encuentro tratando de crear una imagen con algunos módulos personalizados pero tengo un problema al momento de intentar instalar el driver Install the Microsoft ODBC driver for SQL Server (Linux) - ODBC Driver for SQL Server | Microsoft Learn

A continuación les comparto mi Dockerfile:

FROM tryton/tryton:6.0
USER root
RUN mkdir /modules
COPY . /modules
WORKDIR /modules
RUN apt-get update \
    && apt-get install -y curl apt-transport-https \
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update \
    && ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    python3-gi \
    python3-gi-cairo \
    libcairo2-dev \
    && rm -rf /var/lib/apt/lists/*
# RUN pip3 install -r requirements.txt

Al momento de construir la imagen aparece el siguiente error:

executor failed running [/bin/sh -c apt-get update     && apt-get install -y curl apt-transport-https     && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -     && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list     && apt-get update     && ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev]: exit code: 255

Agradezco de ante mano quienes me puedan ayudar :+1:

Acabo de encontrar la solución al error, faltaba instalar el gnupg2 como lo indican en el siguiente enlace docker - E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation - Stack Overflow

Quedando el segundo RUN de la siguiente manera:

RUN apt-get update \
    && apt-get install -y gnupg2 \
    && apt-get install -y curl apt-transport-https \
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update \
    && ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.