Sail is now built on ubuntu 21.10 https://github.com/laravel/sail/blob/1.x/runtimes/8.1/Dockerfile#L1
RUN curl https://packages.microsoft.com/config/ubuntu/21.10/prod.list > /etc/apt/sources.list.d/mssql-release.list
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've been using laravel sail recently, adding sql server as part of the sail container. This was working fine in the previous version of sail (sail v1.13.1 and php v8.0)
I am having trouble making it work with the newer versions of sail and php (sail v1.13.5 and php v8.1)
the docker image builds successfully but when I visit the site url, it gives me a network error:
message: "could not find driver (SQL: select * from [campaigns] order by [created_at] desc)",…}
exception: "Illuminate\Database\QueryException"
file: "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php"
line: 712
im not sure what I am doing wrong, can anyone help? this is the addition I made to the dockerfile:
RUN apt-get update && apt-get install -y gnupg2
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get -y --no-install-recommends install msodbcsql17 unixodbc-dev
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
Please or to participate in this conversation.