Skip to content

Instantly share code, notes, and snippets.

@croblesm
Last active December 7, 2021 18:14
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save croblesm/bb9c27ae4c9784c264147d8ff58d3c25 to your computer and use it in GitHub Desktop.
Save croblesm/bb9c27ae4c9784c264147d8ff58d3c25 to your computer and use it in GitHub Desktop.
msql-tools custom image using Alpine
# SQL Server Command Line Tools - custom image
# From Alpine 3.11 (~5 MBs)
FROM alpine:3.11
LABEL maintainer="@dbamastery"
# Installing system utilities
RUN apk add --no-cache curl gnupg
# Adding custom MS repository for mssql-tools and msodbcsql
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.5.2.1-1_amd64.apk
# Verifying signature
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.sig
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.5.2.1-1_amd64.sig
# Importing gpg key
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import -
RUN gpg --verify msodbcsql17_17.5.2.1-1_amd64.sig msodbcsql17_17.5.2.1-1_amd64.apk && gpg --verify mssql-tools_17.5.2.1-1_amd64.sig mssql-tools_17.5.2.1-1_amd64.apk
# Installing packages
RUN echo y | apk add --allow-untrusted msodbcsql17_17.5.2.1-1_amd64.apk mssql-tools_17.5.2.1-1_amd64.apk
# Adding SQL Server tools to $PATH
ENV PATH=$PATH:/opt/mssql-tools/bin
CMD /bin/sh
@jmarcos-cano
Copy link

Thought there was a way of making a pull request from forked gist to gist, here's my contribution

https://gist.github.com/jmarcos-cano/fbc02fb27dcb2485e82f6f9105aa8fa2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment