Using Microsoft SQL Server in a Linux Container

Some applications might require the use of a database like Microsoft SQL Server. Here is an example of how to include this database in your base image.

  1. Open the Dockerfile_lunix_x64 file in a text editor.
  2. Add the following line after FROM ${BASEOSIMAGE}
     FROM
    mcr.microsoft.com/mssql/server:2022-latest
  3. Add the following lines at the end of the file:
    # Install packages needed to for Microsoft ODBC.
    # This is needed for the runtime to be able to load shared libraries like
    # libodbcinst.so and libodbc.so
    RUN	apt-get install -y unixodbc-dev
    
    # Accept EULA for Microsoft ODBC
    ENV ACCEPT_EULA=Y
  4. Create the base image and application image using the settings you added to the Dockerfile_lunix_x64 file.
    1. Start AcuRCL in a detached container in a detached container that includes the database edit, as follows:
      run_container_AcuRCL.sh
    2. Add the following lines after the last --env:
      	--env "ACCEPT_EULA=Y" \
      	--env "MSSQL_SA_PASSWORD=Passw0rd" \
  5. You can now run your database application using AcuThin.
    Note: If the setup is incorrect, an error in the following form appears in /SharedContainerDirectory/acurcl_linux.out:
    mssql_init
        report_status called from 7994
            [1] HY000 -1 - [dynodbc] Unable to load ODBC driver manager
            ...
            Setting f_errno = 19

    In this case, see Problem-solving on Linux to troubleshoot your setup.