sql server in docker using 15gb of disk space I'm following the instructions here to create my own docker container containing a sql server instance with databases and data configured.

I've added two databases, a few tables containing at most hundreds of items each, and a few stored procedures.

The base sql server image is 1.57 gb . (I'm using 2019-latest).

I would expect the total size to be only slightly higher. However in actual fact the container disk space usage is 15.6GB (virtual 17.1GB).

Does anyone have any idea why this might be, and how it can be reduced?

EDIT 1:
I've just checked and one of the databases I added is 14gb according to SSMS (tasks > shrink > database > currently allocated space). However it contains very little data (It could be scripted in a 1mb file) so I don't know why this is.

EDIT 2: 
Mystery Solved: For some reason the scrript I was using to create the database had allocated 11gb for the log file.
The database files could be using those 15gb even in an newly created and empty database.

You can check the size of the databases using SSMS:



Or check the size of all databases at once using Alex Aza's code or some other code you like from SQL Server 2008: How to query all databases sizes? which is the source of this sample:

with fs
as
(
    select database_id, type, size * 8.0 / 1024 size
    from sys.master_files
)
select 
    name,
    (select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeMB,
    (select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeMB
from sys.databases db


If you see a database that's bigger than expected, you can use DBCC SHRINKFILE (Transact-SQL) to reduce it. Using this command is ok in your specific situation though and not a recommendation to any situation of a big database file.