DevOps Blog - Nicolas Paris

Install dotnet on a Debian based Docker Image

Docker

On a apache buster image, a Debian based image, I need to install a specific version of dotnet. I also need to install a MSSQL driver. They are both available on the same repository, no need to add an extra repository.

You can add the following on your Dockerfile.

FROM php:8.2-apache-buster
RUN 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 install -y dotnet-runtime-6.0

Hope the quick tips can help someone.