Skip to content

Commit b22ade6

Browse files
committed
Build mssql-tools version 18
1 parent a428292 commit b22ade6

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/docker.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,22 @@ jobs:
1919
sqlcmd_minor: "17.4"
2020
sqlcmd_major: ""
2121
latest: false
22+
package_suffix: ""
23+
package_path: "/opt/mssql-tools"
2224
- ubuntu: 22.04
2325
sqlcmd: "17.10.1.1-1"
2426
sqlcmd_minor: "17.10"
2527
sqlcmd_major: "17"
28+
latest: false
29+
package_suffix: ""
30+
package_path: "/opt/mssql-tools"
31+
- ubuntu: 22.04
32+
sqlcmd: "18.2.1.1-1"
33+
sqlcmd_minor: "18.2"
34+
sqlcmd_major: "18"
2635
latest: true # newest possible version available -> tag as latest ubuntu-latest
36+
package_suffix: "18"
37+
package_path: "/opt/mssql-tools18"
2738

2839
env:
2940
IMAGE_NAME_FULL: "fabiang/sqlcmd:${{ matrix.version.sqlcmd }}"
@@ -54,6 +65,8 @@ jobs:
5465
-t '${{ env.IMAGE_NAME_UBUNTU_FULL }}' \
5566
'--build-arg=UBUNTU_VERSION=${{ matrix.version.ubuntu }}' \
5667
'--build-arg=MSSQLTOOLS_VERSION=${{ matrix.version.sqlcmd }}' \
68+
'--build-arg=MSSQLTOOLS_SUFFIX=${{ matrix.version.package_suffix }}' \
69+
'--build-arg=MSSQLTOOLS_PATH=${{ matrix.version.package_path }}' \
5770
.
5871
5972
- name: Test image
@@ -110,7 +123,7 @@ jobs:
110123
docker push '${{ env.IMAGE_LATEST_UBUNTU_MAJOR }}'
111124
112125
- name: Push Lastest
113-
if: "${{ matrix.version.latest == true }}"
126+
if: "${{ matrix.version.latest == true && github.ref == 'refs/heads/main' }}"
114127
run: |
115128
docker push '${{ env.IMAGE_LATEST }}'
116129
docker push '${{ env.IMAGE_LATEST_UBUNTU }}'

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Sqlcmd – command line tool for Microsoft SQL Server.
88

99
## Available tags
1010

11-
* 17.10.1.1-1-ubuntu22.04, 17.10.1.1-1, 17.10-ubuntu, 17.10, 17-ubuntu, 17, latest-ubuntu, latest
11+
* 18.2.1.1-1-ubuntu22.04, 18.2.1.1-1, 18.2-ubuntu, 18.2, 18-ubuntu, 18, latest-ubuntu, latest
12+
* 17.10.1.1-1-ubuntu22.04, 17.10.1.1-1, 17.10-ubuntu, 17.10, 17-ubuntu, 17
1213
* 17.4.1.1-1-ubuntu18.04, 17.4.1.1-1, 17.4-ubuntu, 17.4
1314

1415
## License

ubuntu/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ ARG UBUNTU_VERSION=18.04
22
FROM ubuntu:$UBUNTU_VERSION
33

44
ARG MSSQLTOOLS_VERSION=17.4.1.1-1
5-
ENV PATH=/opt/mssql-tools/bin:$PATH
5+
# Microsoft decided to have a suffix for newer versions of mssql-tools, e.g. mssql-tools18
6+
ARG MSSQLTOOLS_SUFFIX=
7+
# and also the path changed on newer versions. It's a mess.
8+
ARG MSSQLTOOLS_PATH=/opt/mssql-tools
9+
ENV PATH=$MSSQLTOOLS_PATH/bin:$PATH
610

711
RUN apt-get update \
812
&& apt-get install -y curl apt-transport-https locales gnupg2 dos2unix \
@@ -11,7 +15,7 @@ RUN apt-get update \
1115
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
1216
&& curl https://packages.microsoft.com/config/ubuntu/$VERSION_ID/prod.list | tee /etc/apt/sources.list.d/msprod.list \
1317
&& apt-get update \
14-
&& ACCEPT_EULA=Y apt-get install -y mssql-tools=$MSSQLTOOLS_VERSION unixodbc-dev \
18+
&& ACCEPT_EULA=Y apt-get install -y mssql-tools$MSSQLTOOLS_SUFFIX=$MSSQLTOOLS_VERSION unixodbc-dev \
1519
&& apt-get remove -y curl apt-transport-https \
1620
&& rm -f /etc/apt/sources.list.d/msprod.list \
1721
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)