|
1 | | -ARG UBUNTU_VERSION=18.04 |
| 1 | +ARG UBUNTU_VERSION=22.04 |
2 | 2 | FROM ubuntu:$UBUNTU_VERSION |
3 | 3 |
|
4 | | -ARG MSSQLTOOLS_VERSION=17.4.1.1-1 |
| 4 | +ARG MSSQLTOOLS_VERSION=18.2.1.1 |
5 | 5 | # Microsoft decided to have a suffix for newer versions of mssql-tools, e.g. mssql-tools18 |
6 | | -ARG MSSQLTOOLS_SUFFIX= |
| 6 | +ARG MSSQLTOOLS_SUFFIX=18 |
7 | 7 | # and also the path changed on newer versions. It's a mess. |
8 | | -ARG MSSQLTOOLS_PATH=/opt/mssql-tools |
| 8 | +ARG MSSQLTOOLS_PATH=/opt/mssql-tools18 |
| 9 | + |
9 | 10 | ENV PATH=$MSSQLTOOLS_PATH/bin:$PATH |
10 | 11 |
|
11 | | -RUN apt-get update \ |
12 | | - && apt-get install -y curl apt-transport-https locales gnupg2 dos2unix \ |
| 12 | +RUN apt-get -qqq update \ |
| 13 | + && apt-get install -y curl apt-transport-https locales gnupg2 \ |
| 14 | + # Helper command to convert \r\n to \n, |
| 15 | + # since sqlcmd prints Windows line endings |
| 16 | + dos2unix \ |
13 | 17 | && locale-gen "en_US.UTF-8" \ |
| 18 | + \ |
14 | 19 | && export `grep "VERSION_ID" /etc/os-release | sed -e 's/^VERSION_ID=\"/VERSION_ID=/' -e 's/\"$//'` \ |
15 | | - && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ |
16 | | - && curl https://packages.microsoft.com/config/ubuntu/$VERSION_ID/prod.list | tee /etc/apt/sources.list.d/msprod.list \ |
17 | | - && apt-get update \ |
| 20 | + && mkdir -p /etc/apt/keyrings/ \ |
| 21 | + && curl --fail https://packages.microsoft.com/config/ubuntu/$VERSION_ID/prod.list | \ |
| 22 | + sed -E 's#deb\s+\[#deb [signed-by=/etc/apt/keyrings/microsoft.gpg #; t; q1' | \ |
| 23 | + tee /etc/apt/sources.list.d/microsoft.list \ |
| 24 | + && curl --fail https://packages.microsoft.com/keys/microsoft.asc | \ |
| 25 | + gpg --verbose --yes --no-tty --batch --dearmor -o /etc/apt/keyrings/microsoft.gpg \ |
| 26 | + \ |
| 27 | + && apt-get -qqq update \ |
18 | 28 | && ACCEPT_EULA=Y apt-get install -y mssql-tools$MSSQLTOOLS_SUFFIX=$MSSQLTOOLS_VERSION unixodbc-dev \ |
19 | | - && apt-get remove -y curl apt-transport-https \ |
| 29 | + && apt-get remove -y curl apt-transport-https gnupg2 \ |
20 | 30 | && rm -f /etc/apt/sources.list.d/msprod.list \ |
21 | 31 | && rm -rf /var/lib/apt/lists/* |
22 | 32 |
|
|
0 commit comments