Skip to content

Commit 0ebee1b

Browse files
authored
Adding SQL Server 2019 on RHEL 7 example
1 parent ab8c26a commit 0ebee1b

File tree

1 file changed

+25
-0
lines changed
  • linux/preview/examples/mssql-rhel7-sql2019

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SQL Server 2019 on RHEL 7 sample script
2+
# This is a sample script shared to help create the SQL Server 2019 containers images based on RHEL 7
3+
# This script can be modified to add other SQL Server components like polybase, Full text search, and others.
4+
# Base OS layer: latest RHEL 7 latest image
5+
FROM registry.access.redhat.com/rhel7:latest
6+
7+
## Adding the required repos for installing SQL Server, tools, and other dependent packages.
8+
RUN REPOLIST=rhel-7-server-rpms,packages-microsoft-com-mssql-server-2019,packages-microsoft-com-prod && \
9+
curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo && \
10+
curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo && \
11+
ACCEPT_EULA=Y yum -y install --disablerepo "*" --enablerepo ${REPOLIST} --setopt=tsflags=nodocs \
12+
mssql-server mssql-tools unixODBC-devel && \
13+
yum clean all
14+
15+
## Providing the required access to the mssql server folders
16+
RUN mkdir -p -m 770 /var/opt/mssql && chown -R mssql. /var/opt/mssql
17+
18+
## Default SQL Server port
19+
EXPOSE 1433
20+
21+
## Running SQL containers as non-root
22+
USER mssql
23+
24+
## Start SQL server
25+
CMD /opt/mssql/bin/sqlservr

0 commit comments

Comments
 (0)