I am trying to create my own Docker image with MSSQL DB for development. It\'s based on microsoft/mssql-server-linux
image. During the build I want to copy some
From the mssql-server-linux dockerfile, looks like mssql is started on docker run, so you have to modify your last "RUN" command in your dockerfile to start sql-server in the background, run your sql file and stop the sql-server.
RUN /opt/mssql/bin/sqlservr --accept-eula & sleep 10 \
&& /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql \
&& pkill sqlservr