Experimenting a couple things. Running and removing SQL Server on Linux in docker and how to remove the unwanted containers.
Install a couple bogus containers hello-world.
sudo docker run hello-world
sudo docker run hello-world
sudo docker ps -a
sudo docker run hello-world
sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
98f645d63da1 hello-world "/hello" About an hour ago Exited (0) About an hour ago trusting_fermi
02f786dc46e5 ubuntu "bash" About an hour ago Exited (127) About an hour ago confident_hodgkin
17776063d4e8 hello-world "/hello" About an hour ago Exited (0) About an hour ago cocky_wilson
3930eda9c708 microsoft/mssql-server-linux:2017-latest "/opt/mssql/bin/sqls…" About an hour ago Up About an hour 0.0.0.0:1433->1433/tcp sql1
Verify SQL Server running.
#execute docker in interactive mode
sudo docker exec -it sql1 "bash"
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P `password1`
note: sudo within single quote otherwise, it would not locate the container ID.
sudo docker rm `sudo docker ps -aq -f status=exited`
98f645d63da1
02f786dc46e5
17776063d4e8
sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3930eda9c708 microsoft/mssql-server-linux:2017-latest "/opt/mssql/bin/sqls…" About an hour ago Up About an hour 0.0.0.0:1433->1433/tcp sql1
sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3930eda9c708 microsoft/mssql-server-linux:2017-latest "/opt/mssql/bin/sqls…" About an hour ago Up About an hour 0.0.0.0:1433->1433/tcp sql1
#To Delete SQL Server container.
sudo docker stop sql1
sudo docker rm sql1
No comments:
Post a Comment