dockerfile execute mssql script code example
Example 1: docker how to run command in mysql
sudo docker exec -t -i some-mysql /bin/bash
mysql -uroot -pmy-secret-pw
sudo docker run --name mysqldb -e MYSQL_ROOT_PASSWORD=MySecretPass -d mysql:latest
sudo docker start mysqldb
sudo docker exec -t -i mysqldb /bin/bash
mysql -uroot -pMySecretPass
Example 2: docker mssql
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest
docker exec -it [id] /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "<YourStrong@Passw0rd>"