-
Notifications
You must be signed in to change notification settings - Fork 760
/
Dockerfile
46 lines (38 loc) · 1.61 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# mssql-server-rhel
# Maintainers: Travis Wright (twright-msft on GitHub)
# GitRepo: https://github.com/twright-msft/mssql-server-rhel
# Base OS layer: latest CentOS 7
FROM centos:7
### Atomic/OpenShift Labels - https://github.com/projectatomic/ContainerApplicationGenericLabels
LABEL name="microsoft/mssql-server-linux" \
vendor="Microsoft" \
version="14.0" \
release="1" \
summary="MS SQL Server" \
description="MS SQL Server is ....." \
### Required labels above - recommended below
url="https://www.microsoft.com/en-us/sql-server/" \
run='docker run --name ${NAME} \
-e ACCEPT_EULA=Y -e SA_PASSWORD=yourStrong@Password \
-p 1433:1433 \
-d ${IMAGE}' \
io.k8s.description="MS SQL Server is ....." \
io.k8s.display-name="MS SQL Server"
# Install latest mssql-server package
RUN curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo && \
curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo && \
ACCEPT_EULA=Y yum install -y mssql-server mssql-tools unixODBC-devel && \
yum clean all
COPY uid_entrypoint /opt/mssql-tools/bin/
ENV PATH=${PATH}:/opt/mssql/bin:/opt/mssql-tools/bin
RUN mkdir -p /var/opt/mssql/data && \
chmod -R g=u /var/opt/mssql /etc/passwd
### Containers should not run as root as a good practice
USER 10001
# Default SQL Server TCP/Port
EXPOSE 1433
VOLUME /var/opt/mssql/data
### user name recognition at runtime w/ an arbitrary uid - for OpenShift deployments
ENTRYPOINT [ "uid_entrypoint" ]
# Run SQL Server process
CMD sqlservr