Rigerta
Rigerta

Reputation: 4039

windows container OS version

I have recently started experimenting with Docker and SQL Server on Windows Containers. I have pulled this image of MSSQL Server on Windows:

microsoft/mssql-server-windows-developer

I would like to find out the OS version my Windows image is running on.

According to the documentation, it should be running Windows Server, but I would actually like to see it.

I have tried the following on Powershell, but this gives me the OS I am running on my local machine (which is Windows 10):

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

Is there a way to find out the same info for my Windows container?

Upvotes: 1

Views: 1320

Answers (1)

CodedBeard
CodedBeard

Reputation: 912

You need to use docker exec to run commands in the container.

First run docker ps to get the container ID, then run the following command with the relevant container ID in place of <CONTAINERID>

docker exec <CONTAINERID> powershell -command {systeminfo | findstr /B /C:"OS Name" /C:"OS Version"}

Incidentally, the official MS container images are always based off of data center edition, so you only really need to look at the build number, which can be obtained faster using the $PsVersionTable

docker exec <CONTAINERID> powershell -command {$PsVersionTable}

Upvotes: 1

Related Questions