|
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. |
| 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 |
7 | 6 |
|
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 |
| 7 | +3. You can verify that the host machine is registered using a command shown below, the output you should see the status as registered and other details like the regcode. |
| 8 | + ``` |
| 9 | + SUSEConnect -s |
| 10 | + ``` |
20 | 11 |
|
21 | 12 | **Steps to building SQL Server on SLES container image** |
22 | 13 |
|
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 | | - ``` |
| 14 | +1. Create the dockerfile as shown in the dockerfile command and save it into your working directory |
| 15 | +
|
28 | 16 | 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 | 17 |
|
30 | 18 | 3. Build the docker image. |
31 | 19 | ``` |
32 | | - docker build . -t mssql-sles |
| 20 | + docker build . -t mssql-sles-tools-nonroot |
| 21 | + ``` |
| 22 | +4. Confirm the image is successfully created using the command |
| 23 | + ``` |
| 24 | + docker images |
33 | 25 | ``` |
34 | 26 | 4. Run the docker image. |
35 | 27 | ``` |
36 | 28 | sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' \ |
37 | 29 | -p 1433:1433 --name sql1 \ |
38 | | - -d mssql-sles |
| 30 | + -d mssql-sles-tools-nonroot |
39 | 31 | ``` |
0 commit comments