Skip to content

Instantly share code, notes, and snippets.

@DiomedesDominguez
Created December 11, 2019 21:50
Show Gist options
  • Save DiomedesDominguez/4df96dae19d5cf3c6c8d21327b0b4713 to your computer and use it in GitHub Desktop.
Save DiomedesDominguez/4df96dae19d5cf3c6c8d21327b0b4713 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/mssql/server:latest as base
USER root
LABEL MAINTAINER=DNMOFT
EXPOSE 80
EXPOSE 1433
EXPOSE 443
ENV ACCEPT_EULA=Y
ENV SA_PASSWORD=Code1234,
#ENV MSSQL_PID=Enterprise
ENV MSSQL_TCP_PORT=1433
WORKDIR /app
RUN apt-get update \
&& apt-get install -y wget \
&& apt-get install -y gnupg2 \
&& apt-get install -y software-properties-common \
&& apt-get install -y apt-utils \
&& apt-get update \
&& wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install apt-transport-https \
&& apt-get update \
&& apt-get autoremove \
&& apt-get install -y aspnetcore-runtime-3.1
RUN (/opt/mssql/bin/sqlservr --accept-eula & ) | grep -q "Service Broker manager has started" \
&& /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P Code1234, -Q "exec sp_configure 'show advanced options',1; reconfigure; exec sp_configure 'Agent XPs',1; reconfigure; exec sp_configure 'remote admin connections',1; reconfigure;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment