When I was downsizing Docker Image at work, I was in trouble because I couldn't install mssql-tools with alpine. While investigating the method, there was a person who gave a solution to Git, so I referred to it and solved it. Leave the procedure at that time as a memorandum.
https://packages.microsoft.com/config/
github issues does not close at this time (2020/11/6), but [Install the Microsoft ODBC driver for SQL Server ( Linux)](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server- There is a sample in 2017 # alpine-linux), so please refer to it.
As you read on the issues, dbamaster has posted a sample of DockerFile on github! Nice https://github.com/dbamaster/mssql-tools-alpine
I used the following installation command part as a reference for my Docker File.
# Installing system utilities
RUN apk add --no-cache curl gnupg --virtual .build-dependencies -- && \
# Adding custom MS repository for mssql-tools and msodbcsql
curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MSSQL_VERSION}_amd64.apk && \
curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_${MSSQL_VERSION}_amd64.apk && \
# Verifying signature
curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MSSQL_VERSION}_amd64.sig && \
curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_${MSSQL_VERSION}_amd64.sig && \
# Importing gpg key
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import - && \
gpg --verify msodbcsql17_${MSSQL_VERSION}_amd64.sig msodbcsql17_${MSSQL_VERSION}_amd64.apk && \
gpg --verify mssql-tools_${MSSQL_VERSION}_amd64.sig mssql-tools_${MSSQL_VERSION}_amd64.apk && \
# Installing packages
echo y | apk add --allow-untrusted msodbcsql17_${MSSQL_VERSION}_amd64.apk mssql-tools_${MSSQL_VERSION}_amd64.apk && \
# Deleting packages
apk del .build-dependencies && rm -f msodbcsql*.sig mssql-tools*.apk
Recommended Posts