|
1 | 1 | # How to build a SQL Server on SLES container image |
2 | 2 |
|
3 | | -**Prerequisites - Get SLES Container Images** |
4 | | -SUSE Enterprise Linux Containers are not avalaible on any public repositories. Follow the steps below to get the container base OS locally: |
| 3 | +1. Ensure that host machine is running the same version of the SLES that you will build SQL Server 2019 container image, in this case we are using a host which is running SLES 12 SP 5 and building the SQL Server also on top of SLES 12 SP 5. |
5 | 4 |
|
6 | | -a. Activate the container module via yast by typing in ```yast2``` and following the prompts. |
7 | | - |
8 | | -b. Search for the available SLES images with ```zypper se *-image``` |
9 | | - |
10 | | -c. Install one of those images with zypper install, for example, ```zypper in sles12sp2-docker-image``` |
11 | | - |
12 | | -d. List out the installed images with ```sle2docker list``` |
13 | | - |
14 | | -e. Activate the image with sle2docker, for example ```sle2docker activate sles12sp1-docker.x86_64-1.0.5-Build10.18``` |
15 | | - |
16 | | -f. Check that the image available with ```docker image ls``` |
17 | | - |
18 | | - |
19 | | -For full details: https://www.suse.com/documentation/sles-12/singlehtml/book_sles_docker/book_sles_docker.html#docker.building.images |
| 5 | +2. Please ensure the host machine is registered using the SUSEConnect command as documented here: https://www.suse.com/support/kb/doc/?id=000018564 |
20 | 6 |
|
21 | 7 | **Steps to building SQL Server on SLES container image** |
22 | 8 |
|
23 | | -1. Copy the SUSE_Linux_Enterprise_Server zypper repository and service files into this directory which is required for the *libsss_nss_idmap0* package. Example: |
24 | | - ``` |
25 | | - sudo cp /etc/zypp/services.d/SUSE_Linux_Enterprise_Server_12_SP4_x86_64.service /path/to/dockerfile/ |
26 | | - sudo cp /etc/zypp/repo.d/SUSE_Linux_Enterprise_Server_12_SP4_x86_64:SLES12-SP4-Pool.repo /path/to/dockerfile/ |
27 | | - ``` |
| 9 | +1. Create the dockerfile as shown in the dockerfile command and save it into your working directory |
| 10 | + |
28 | 11 | 2. [optional] Customize the mssql.conf file. Example mssql.conf entries can be found here: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-mssql-conf?view=sql-server-2017#mssql-conf-format |
29 | 12 |
|
30 | 13 | 3. Build the docker image. |
31 | 14 | ``` |
32 | | - docker build . -t mssql-sles |
| 15 | + docker build . -t mssql-sles-tools-nonroot |
| 16 | + ``` |
| 17 | +4. Confirm the image is successfully created using the command |
| 18 | + ``` |
| 19 | + docker images |
33 | 20 | ``` |
34 | 21 | 4. Run the docker image. |
35 | 22 | ``` |
36 | 23 | sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' \ |
37 | 24 | -p 1433:1433 --name sql1 \ |
38 | | - -d mssql-sles |
| 25 | + -d mssql-sles-tools-nonroot |
39 | 26 | ``` |
0 commit comments