I am trying to run a Windows application inside Docker that needs to connect to an MSSQL database. I can successfully connect to the database using the same connection string that the app is using via isql, however my app is unable to connect. This is the error that I get:
Code: Select all
winediag:load_odbc failed to open library "/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.6.1": /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.6.1: wrong ELF class: ELFCLASS64
Code: Select all
FROM jlesage/baseimage-gui:ubuntu-22.04-v4
ARG WINE_VERSION=stable
ENV WINEARCH=win32
ENV WINEDEBUG=fixme-all+odbc32
ENV WINE_ARGS='App.exe'
ENV LIB_ODBC_DRIVER_MANAGER=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.6.1
ENV WORKDIR=/etc/services.d/app
ENV DEBIAN_FRONTEND=noninteractive
# Install wine and dependencies - https://wiki.winehq.org/Ubuntu
RUN dpkg --add-architecture i386 \
&& apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
ca-certificates \
software-properties-common \
gnupg2 \
apt-transport-https \
gpg-agent \
rename \
cabextract \
xvfb \
&& mkdir -pm755 /etc/apt/keyrings \
&& wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key \
&& wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources \
&& apt-get update && apt-get install -y --install-recommends \
winehq-${WINE_VERSION} \
wine-${WINE_VERSION} \
winbind \
&& rm -rf /var/lib/apt/lists/*
# Install winetricks
RUN wget -nv https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
&& chmod +x winetricks \
&& mv winetricks /usr/local/bin
RUN winetricks win7
RUN xvfb-run -a winetricks -q dotnet35 vcrun2017
# Install Microsoft ODBC 17
RUN curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc \
&& curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | tee /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y \
msodbcsql17 \
mssql-tools \
unixodbc-dev \
&& rm -rf /var/lib/apt/lists/* \
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc \
&& export PATH="$PATH:/opt/mssql-tools/bin"
WORKDIR ${WORKDIR}
RUN chown -R ${USER_ID}:${GROUP_ID} ${WORKDIR}
RUN chown -R ${USER_ID}:${GROUP_ID} /root/.wine
COPY App.exe .
COPY --chmod=655 startapp.sh /startapp.sh
Code: Select all
#!/bin/bash
exec wine $WINE_ARGS
Code: Select all
ENV WINEARCH=win32
Code: Select all
ENV WINEARCH=win64
Thank you for any help in advance!