Saturday, November 9, 2019

Install SQL Server 2019 using Docker image


[root@devops ~]# docker pull mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
2019-GA-ubuntu-16.04: Pulling from mssql/server
59ab41dd721a: Pull complete 
57da90bec92c: Pull complete 
06fe57530625: Pull complete 
5a6315cba1ff: Pull complete 
739f58768b3f: Pull complete 
fd449e8d7345: Pull complete 
51d0933375e5: Pull complete 
64f21ba81504: Pull complete 
55b6919c0cc6: Pull complete 
Digest: sha256:c8fa22553ce421b0482febcafa712b29cbb933b0d97a8671686797b31cf157a9
Status: Downloaded newer image for mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
[root@devops ~]# docker images
REPOSITORY                       TAG                    IMAGE ID            CREATED             SIZE
mcr.microsoft.com/mssql/server   2019-GA-ubuntu-16.04   76c7c66bff02        4 weeks ago         1.57GB
centos                           latest                 0f3e07c0138f        5 weeks ago         220MB
oraclelinux                      7-slim                 874477adb545        3 months ago        118MB
[root@devops ~]# 

[root@devops ~]# docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Strong!Passw0' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
ddf33243ed48c608af08f47340452bbff23a11e22ac6546675b3f4511d9bf9b4


[root@devops ~]# docker ps
CONTAINER ID        IMAGE                                                 COMMAND                  CREATED             STATUS              PORTS                    NAMES
ddf33243ed48        mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04   "/opt/mssql/bin/perm…"   14 seconds ago      Up 13 seconds       0.0.0.0:1433->1433/tcp   quirky_moore

[root@devops ~]# docker exec -it ddf33243ed48 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Strong!Passw0'
1> select @@version;
2> go
--------------------------------------------------------------------
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) 
Sep 24 2019 13:48:23 
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 16.04.6 LTS)                                                                                                                        
(1 rows affected)
1> exit


[root@devops ~]# docker version
Client: Docker Engine - Community
 Version:           19.03.4
 API version:       1.40
 Go version:        go1.12.10
 Git commit:        9013bf583a
 Built:             Fri Oct 18 15:52:22 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.4
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.10
  Git commit:       9013bf583a
  Built:            Fri Oct 18 15:50:54 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.6
  GitCommit:        894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc:
  Version:          1.0.0-rc8
  GitCommit:        425e105d5a03fabd737a126ad93d62a9eeede87f
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683