There is this error and I tried to change my Dockerfile but nothing seems to work.
I’m currently on MacOS 14.3 and working with Docker for Desktop
Heres part of my file that’s probably causing problems:
FROM php:8.3-fpm
RUN apt-get update --fix-missing
&& apt-get -y install libicu-dev libonig-dev libzip-dev gnupg
unzip locales libxml2-dev wget software-properties-common supervisor gcc make autoconf
RUN apt-get update && apt-get install -y lsb-release gnupg
&& echo "deb [arch=amd64] https://packages.microsoft.com/debian/10/prod buster main" > /etc/apt/sources.list.d/mssql-release.list
&& apt-get update
&& apt-get install -y --no-install-recommends apt-transport-https
RUN gpg --keyserver keyserver.ubuntu.com --recv-key EB3E94ADBE1229CF
&& gpg -a --export EB3E94ADBE1229CF | apt-key add - && apt-get update
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/10/prod buster main" > /etc/apt/sources.list.d/mssql-release.list
&& apt-get update
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17
and there is error that keeps on poping up:
2.368 Get:4 https://packages.microsoft.com/debian/10/prod buster InRelease [6537 B]
2.419 Err:4 https://packages.microsoft.com/debian/10/prod buster InRelease
2.419 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
2.428 Reading package lists...
2.631 W: GPG error: https://packages.microsoft.com/debian/10/prod buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
2.631 E: The repository 'https://packages.microsoft.com/debian/10/prod buster InRelease' is not signed.
------
failed to solve: process "/bin/sh -c apt-get update && apt-get install -y lsb-release gnupg && echo "deb [arch=amd64] https://packages.microsoft.com/debian/10/prod buster main" > /etc/apt/sources.list.d/mssql-release.list && apt-get update && apt-get install -y --no-install-recommends apt-transport-https" did not complete successfully: exit code: 100
`docker-compose` process finished with exit code 17
2
Answers
after a lot of research I finally found good solution that worked for me so I want to post how my file looks like after many iterations and it seems to be working for now!
When creating new
Dockerfile
s I recommend usingdocker run
to build out and test your installation steps, because many warnings and some errors are hidden away by thedocker build
anddocker-compose
tools.The way Debian manages package signing keys has changed over time. This old way of installing keys using
apt-key
no longer works:Although updated from this, even Microsoft’s instructions at Install the Microsoft ODBC driver for SQL Server (Linux) are out of date and incorrect for Debian 12:
For Debian 12 specifically this doesn’t work because the repo at https://packages.microsoft.com/config/debian/12/prod.list contains a reference to a specific local .gpg file:
To make this work you need the following command instead (thanks to Debian 12 public key is not available):
Testing with
docker run -it -u 0 --rm php:8.3-fpm /bin/bash
a complete recipe for Debian 12, based in Microsoft’s instructions but actually working, looks like the following: