0% found this document useful (0 votes)
17 views22 pages

Build and Run Your First Docker Windows Server Container _ Docker Blog

Starting November 2nd, Docker Hub will implement pull rate limits for certain users. The document provides a guide on setting up and running Docker Windows containers on Windows 10 and Windows Server 2016, detailing installation steps, Docker Engine configuration, and usage of Docker Compose. It also highlights the importance of using Windows Server 2016 for production deployments and offers troubleshooting tips for common issues.

Uploaded by

Ivan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views22 pages

Build and Run Your First Docker Windows Server Container _ Docker Blog

Starting November 2nd, Docker Hub will implement pull rate limits for certain users. The document provides a guide on setting up and running Docker Windows containers on Windows 10 and Windows Server 2016, detailing installation steps, Docker Engine configuration, and usage of Docker Compose. It also highlights the importance of using Windows Server 2016 for production deployments and offers troubleshooting tips for common issues.

Uploaded by

Ivan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Pull rate limits for certain users are being introduced to Docker Hub starting November 2nd.

Learn more

Why Docker? Products Developers Pricing Company Sign In Get Started

Build and run your first   

Docker Windows Server Post Tags

container 


Docker engine
docker for windows
windows 10
 Windows Server
 Windows Server Containers

Categories
MICHAEL FRIIS
Sep 26 2016
 All
 Products
 Community
Today, Microsoft announced the general availability of Windows Server 2016, and with it, Docker engine
 Engineering
running containers natively on Windows. This blog post describes how to get setup to run Docker Windows
 Company
Containers on Windows 10 or using a Windows Server 2016 VM. Check out the companion blog posts on the
technical improvements that have made Docker containers on Windows possible and the post announcing
the Docker Inc. and Microsoft partnership.

Before getting started, It’s important to understand that Windows Containers run Windows executables
compiled for the Windows Server kernel and userland (either windowsservercore or nanoserver). To build and
run Windows containers, a Windows system with container support is required.

Windows 10 with Anniversary Update


For developers, Windows 10 is a great place to run Docker Windows containers and containerization support
was added to the the Windows 10 kernel with the Anniversary Update (note that container images can only
be based on Windows Server Core and Nanoserver, not Windows 10). All that’s missing is the Windows-native
Docker Engine and some image base layers.

The simplest way to get a Windows Docker Engine is by installing the Docker for Windows public beta (direct
download link). Docker for Windows used to only setup a Linux-based Docker development environment
(slightly confusing, we know), but the public beta version now sets up both Linux and Windows Docker
development environments, and we’re working on improving Windows container support and Linux/Windows
container interoperability.

With the public beta installed, the Docker for Windows tray icon has an option to switch between Linux and
Windows container development. For details on this new feature, check out Stefan Scherers blog post.

Switch to Windows containers and skip the next section.

Windows Server 2016


Windows Server 2016 is the where Docker Windows containers should be deployed for production. For
developers planning to do lots of Docker Windows container development, it may also be worth setting up a
Windows Server 2016 dev system (in a VM, for example), at least until Windows 10 and Docker for Windows
support for Windows containers matures.

For Microsoft Ignite 2016 conference attendees, USB flash drives with Windows Server 2016 preloaded are
available at the expo. Not at ignite? Download a free evaluation version and install it on bare metal or in a VM
running on Hyper-V, VirtualBox or similar. Running a VM with Windows Server 2016 is also a great way to do
Docker Windows container development on macOS and older Windows versions.

Once Windows Server 2016 is running, log in, run Windows Update to ensure you have all the latest updates
and install the Windows-native Docker Engine directly (that is, not using “Docker for Windows”). Run the
following in an Administrative PowerShell prompt:
Install‐PackageProvider ‐Name NuGet ‐MinimumVersion 2.8.5.201 ‐Force
Install‐Module ‐Name DockerMsftProvider ‐Force
Install‐Package ‐Name docker ‐ProviderName DockerMsftProvider ‐Force
Restart‐Computer ‐Force

Docker Engine is now running as a Windows service, listening on the default Docker named pipe. For
development VMs running (for example) in a Hyper-V VM on Windows 10, it might be advantageous to make
the Docker Engine running in the Windows Server 2016 VM available to the Windows 10 host:

# Open firewall port 2375


netsh advfirewall firewall add rule name="docker engine" dir=in action=allow protocol=TCP localport=2375

# Configure Docker daemon to listen on both pipe and TCP (replaces docker ‐‐register‐service invocation above)
Stop‐Service docker
dockerd ‐‐unregister‐service
dockerd ‐H npipe:// ‐H 0.0.0.0:2375 ‐‐register‐service
Start‐Service docker

The Windows Server 2016 Docker engine can now be used from the VM host by setting DOCKER_HOST :

$env:DOCKER_HOST = "<ip‐address‐of‐vm>:2375"

See the Microsoft documentation for more comprehensive instructions.

Running Windows containers


First, make sure the Docker installation is working:

> docker version


Client:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:32:24 2016
OS/Arch: windows/amd64
Experimental: true

Server:
Version: 1.12.2‐cs2‐ws‐beta
API version: 1.25
Go version: go1.7.1
Git commit: 62d9ff9
Built: Fri Sep 23 20:50:29 2016
OS/Arch: windows/amd64

Next, pull a base image that’s compatible with the evaluation build, re-tag it and to a test-run:

docker pull microsoft/windowsservercore


docker run microsoft/windowsservercore hostname
69c7de26ea48

Building and pushing Windows container


images
Pushing images to Docker Cloud requires a free Docker ID. Storing images on Docker Cloud is a great way to
save build artifacts for later user, to share base images with co-workers or to create build-pipelines that move
apps from development to production with Docker.

Docker images are typically built with docker build from a Dockerfile recipe, but for this example, we’re going
to just create an image on the fly in PowerShell.

"FROM microsoft/windowsservercore `n CMD echo Hello World!" | docker build ‐t <docker‐id>/windows‐test‐image ‐

Test the image:

docker run <docker‐id>/windows‐test‐image


Hello World!
Login with docker login and then push the image:

docker push <docker‐id>/windows‐test‐image

Images stored on Docker Cloud available in the web interface and public images can be pulled by other
Docker users.

Using docker-compose on Windows


Docker Compose is a great way develop complex multi-container consisting of databases, queues and web
frontends. Compose support for Windows is still a little patchy and only works on Windows Server 2016 at the
time of writing (i.e. not on Windows 10).

To develop with Docker Compose on a Windows Server 2016 system, install compose too (this is not required
on Windows 10 with Docker for Windows installed):

Invoke‐WebRequest https://dl.bintray.com/docker‐compose/master/docker‐compose‐Windows‐x86_64.exe ‐UseBasicParsing ‐OutFile $env:ProgramFiles\docker\docker‐compose.

To try out Compose on Windows, clone a variant of the ASP.NET Core MVC MusicStore app, backed by a SQL
Server Express 2016 database. A correctly tagged microsoft/windowsservercore image is required before
starting.

git clone https://github.com/friism/Musicstore


...
cd Musicstore
docker‐compose ‐f .\docker‐compose.windows.yml build
...
docker‐compose ‐f .\docker‐compose.windows.yml up
...

To access the running app from the host running the containers (for example when running on Windows 10
or if opening browser on Windows Server 2016 system running Docker engine) use the container IP and port
5000. localhost will not work:

docker inspect ‐f "{{ .NetworkSettings.Networks.nat.IPAddress }}" musicstore_web_1


172.21.124.54

If using Windows Server 2016 and accessing from outside the VM or host, simply use the VM or host IP and
port 5000.

Summary
This post described how to get setup to build and run native Docker Windows containers on both Windows
10 and using the recently published Windows Server 2016 evaluation release. To see more example Windows
Dockerfiles, check out the Golang, MongoDB and Python Docker Library images.
Please share any Windows Dockerfiles or Docker Compose examples your build with @docker on Twitter
using the tag #windows. And don’t hesitate to reach on the Docker Forums if you have questions.

More Resources:
Sign up to be notified of GA and the Docker Datacenter for Windows Beta
Register for a webinar: Docker for Windows Server
Learn more about the Docker and Microsoft partnership

Build and run your first #Docker @Windows #Server #container


CLICK TO TWEET

 Docker engine, docker for windows, windows 10, Windows Server, Windows Server Containers

Feedback
 76 thoughts on “Build and run your first Docker Windows Server container”

JGAITPro
September 26, 2016 at 2:19 pm

Hello, when starting the service displays the following error docker:
Start-Service : No pudo iniciarse el servicio 'Docker Engine (docker)'.
En línea: 1 Carácter: 1
+ Start-Service docker
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

Thanks!

 Reply

Michael Friis
September 28, 2016 at 7:15 pm

This suggests that the `dockerd –register-service` step didn't succeed.

 Reply

Kevin Jenkins
October 13, 2016 at 10:50 am

im having the same issue however it seems that the service did succeed

 Reply

putri
April 27, 2017 at 6:11 am

I have the same problem, but when I try 'dockerd –register-service', the output says:

level=fatal msg="The specified service already exists."

What should I do?

 Reply

Ravi
September 27, 2016 at 2:47 am

Hello Michael, successfully build but getting error while compose. Requesting, Please do the need.
PS C:\Musicstore> docker-compose -f .\src\MusicStore\docker-compose.yml up

docker-compose : The term 'docker-compose' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ docker-compose -f .\src\MusicStore\docker-compose.yml up
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (docker-compose:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

 Reply

Michael Friis
September 28, 2016 at 7:16 pm

You have to dowload the compose executable, rename it to `docker-compose.exe` and place it
somewhere in your path (for example in `$env:ProgramFiles\docker` with `docker.exe` and
`dockerd.exe`.)

 Reply

Robert Colbert
September 27, 2016 at 7:03 am

I'll be filing a bug on GitHub but wanted to share this. If you normally compress your system drive, the
following folders must be uncompressed for Hyper-V containers to run:
C:\ProgramData\Microsoft\Windows\Hyper-V\Container Images Store
C:\ProgramData\Microsoft\Windows\Hyper-V\Conttainer Utility VM
C:\ProgramData\Docker\windowsfilter
If they are compressed, Docker will fail to launch the container.

 Reply

Michael Friis
September 28, 2016 at 7:17 pm

Nice find, thanks!

 Reply

Jay
September 27, 2016 at 8:05 pm

I installed the beta but there is no menu to switch to Windows container. I'm on Windows 10 Anniversary
Update. What could be the problem?

 Reply

Michael Friis
September 28, 2016 at 7:17 pm

That sounds very strange, please open an issue here with version information:
https://github.com/docker/for-win/issues

 Reply

Sasi
September 29, 2016 at 9:13 pm

Getting the below error while running docker-compose up. Any idea please? (i am using Windows Server
2016 TP5 BTW)

PS C:\> docker-compose up -d
Recreating default_web_1

ERROR: for web Windows does not support disconnecting a running container from a network
ERROR: Encountered errors while bringing up the project.

 Reply

Michael Friis
October 18, 2016 at 7:06 am

You have to use the default network and a recent version of Docker Compose:

networks:
default:
external:
name: nat

https://github.com/friism/MusicStore/blob/master/docker-compose.windows.yml

 Reply

George
September 30, 2016 at 8:24 am

We have pretty good Linux docker in docker build pipeline for our NodeJS micro services services. We're
looking to build a UWP app and wondering if there's a similar pattern we can implement. We made some
initial attempts using nano and core but there seemed to be missing pieces to get a UWP build working.

 Reply

Johnny
October 10, 2016 at 2:02 pm

I installed docker version 1.13.0-dev directly following the instructions here:


https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_10
Is there any way to switch between Linux and Windows? It looks like I'm missing DockerCli.

 Reply

Michael Friis
October 18, 2016 at 7:07 am

To get the switch, you have to install Docker for Windows: https://docs.docker.com/docker-for-
windows/

 Reply

Cormac
October 19, 2016 at 9:59 am

I successfully installed docker for windows beta on latest windows 10 anniversary (10.0.14393) , and ran
successfully the hello world app (in linux container mode) through powershell. Then i changed to
windows container mode. I could not successfully pull any windows images. Some of the images dont
mention windows 10 anniv . Does this mean they will not run on in it? Or could i be missing some other
packages?

docker pull microsoft/windowsservercore – failed with Docker : local error: tls: record overflow

docker pull microsoft/mssql-server – kept freezing with the message: Please login prior to pull:

docker pull microsoft/aspnet – components appear to fail to download with a 'Retrying in xx seconds '
message.

A second effort got a lot further, but hung at 'download complete' for one of the components.

PS C:\Windows\system32> docker info


Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.12.2-cs2-ws-beta
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: nat null overlay
Swarm: inactive
Security Options:
Kernel Version: 10.0 14393 (14393.321.amd64fre.rs1_release_inmarket.161004-2338)
Operating System: Windows 10 Enterprise
OSType: windows
Architecture: x86_64
CPUs: 16
Total Memory: 31.91 GiB
Name: TheOrcWin10E
ID: KFA6:43UR:QW2A:MGES:E6RO:K5GW:B5YM:ZOSR:JAEC:KM3Q:Y3PG:V6D2
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8

Do we know if these containers will run on win 10 anniv, and is there an alternative method to manually
download the containers?

 Reply

Cormac
October 19, 2016 at 10:07 am

Addendum to the above!: THe second pull attempt for microsoft/aspnet did seem to complete
successfully:

PS C:\Windows\system32> docker pull microsoft/aspnet


Using default tag: latest
latest: Pulling from microsoft/aspnet
9c7f9c7d9bc2: Pulling fs layer
de5064718b3f: Pulling fs layer
3abe74683942: Pulling fs layer
907e871a8de2: Pulling fs layer
ba066d7d1bad: Pulling fs layer
b8c8a13e99c3: Pulling fs layer
907e871a8de2: Waiting
ba066d7d1bad: Waiting
b8c8a13e99c3: Waiting
3abe74683942: Verifying Checksum
3abe74683942: Download complete
907e871a8de2: Verifying Checksum
907e871a8de2: Download complete
ba066d7d1bad: Verifying Checksum
ba066d7d1bad: Download complete
b8c8a13e99c3: Verifying Checksum
b8c8a13e99c3: Download complete
de5064718b3f: Retrying in 5 seconds
de5064718b3f: Retrying in 4 seconds
de5064718b3f: Retrying in 3 seconds
de5064718b3f: Retrying in 2 seconds
de5064718b3f: Retrying in 1 second
de5064718b3f: Retrying in 10 seconds
de5064718b3f: Retrying in 9 seconds
de5064718b3f: Retrying in 8 seconds
de5064718b3f: Retrying in 7 seconds
de5064718b3f: Retrying in 6 seconds
de5064718b3f: Retrying in 5 seconds
de5064718b3f: Retrying in 4 seconds
de5064718b3f: Retrying in 3 seconds
de5064718b3f: Retrying in 2 seconds
de5064718b3f: Retrying in 1 second
de5064718b3f: Verifying Checksum
de5064718b3f: Download complete
9c7f9c7d9bc2: Verifying Checksum
9c7f9c7d9bc2: Download complete
9c7f9c7d9bc2: Pull complete
de5064718b3f: Pull complete
3abe74683942: Pull complete
907e871a8de2: Pull complete
ba066d7d1bad: Pull complete
b8c8a13e99c3: Pull complete
Digest: sha256:6d5c0e56fb5f3af4204f42674b0e2ef5ed27fec4791542a0b8df0dd187ed9ccb
Status: Downloaded newer image for microsoft/aspnet:latest

PS C:\Windows\system32>

 Reply

Erik
October 25, 2016 at 11:36 am

I'm not sure what's going on here, but when I reach the Install-Package step to install docker, I get the
message:

WARNING: Cannot find path


'C:\Users\ADMINI~1\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json'
because it does not
exist.
WARNING: Cannot bind argument to parameter 'downloadURL' because it is an empty string.
WARNING: The property 'AbsoluteUri' cannot be found on this object. Verify that the property exists.
WARNING: The property 'RequestMessage' cannot be found on this object. Verify that the property
exists.
Install-Package : No match was found for the specified search criteria and package name 'docker'. Try
Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider -Force

Any ideas?

 Reply

Michael Friis
October 29, 2016 at 10:32 am

That sounds like an error with the package installer. Please open an issue here:
https://github.com/OneGet/MicrosoftDockerProvider

 Reply

John Waters
October 27, 2016 at 10:48 am

Running the compose example,

docker-compose -f .\docker-compose.windows.yml build

Half way through I get

"Unable to load the service index for source https://dotnet.myget.org/F/aspnetcore-ci-


dev/api/v3/index.json.&quot;
The server name or address could not be resolved
 Reply

Michael Friis
October 29, 2016 at 10:34 am

Strange, that looks like a generic NuGet error – maybe you had an intermittent internet connection
problem or similar. Could you try building again?

 Reply

Andy
February 17, 2017 at 4:46 pm

I also get the same error:

log : Restoring packages for C:\MusicStore\samples\MusicStore.Standalone\project.json…


error: Unable to load the service index for source https://dotnet.myget.org/F/aspnetcore-ci-
dev/api/v3/index.json.
error: An error occurred while sending the request.
error: The server name or address could not be resolved
ERROR: Service 'web' failed to build: The command 'powershell -Command
$ErrorActionPreference = 'Stop'; $ProgressPrefere
nce = 'SilentlyContinue'; dotnet restore .\samples\MusicStore.Standalone' returned a non-zero
code: 1

 Reply

VSankar
April 28, 2017 at 4:30 pm

I'm also getting the same error.. I checked my internet and its working fine…I tried several
time and I also try by modifying NuGet.config with

<?xml version="1.0" encoding="utf-8"


<configuration>
<packageSources>
<clear />
<add key="AspNetVNext" value="https://dotnet.myget.org/F/aspnetcore-
dev/api/v3/index.json&quot; />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json&quot; />
</packageSources>
</configuration>

Error Details Follows


Step 9/15 : RUN dotnet restore –runtime win10-x64 .\samples\MusicStore
—> Running in 5925d4f82a5a
Restoring packages for C:\MusicStore\samples\MusicStore\MusicStore.csproj…
C:\Program Files\dotnet\sdk\1.0.1\NuGet.targets(97,5): error : Unable to load the service
index for source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json.
[C:\MusicStore\samples\MusicStore\MusicStore.csproj]
C:\Program Files\dotnet\sdk\1.0.1\NuGet.targets(97,5): error : An error occurred while
sending the request. [C:\MusicStore\samples\MusicStore\MusicStore.csproj]
C:\Program Files\dotnet\sdk\1.0.1\NuGet.targets(97,5): error : The operation timed out
[C:\MusicStore\samples\MusicStore\MusicStore.csproj]
ERROR: Service 'web' failed to build: The command 'powershell -Command
$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; dotnet restore
–runtime win10-x64 .\samples\MusicStore' returned a non-zero code: 1

 Reply

XA
October 31, 2016 at 4:08 pm

Hello Michael,

docker-compose.yml now supports on windows also ? i have one docker-compose.yml file which was
built for linux system base image. can i run the same on windows ?
moreover i have all the DockerFiles built for linux systems now we need to make it for windows and
facing really difficult time here. any tool which can help for that ?

 Reply

bora
November 4, 2016 at 1:46 am
Hi,

I am using 2016 server with Docker setup as an development machine.

I am trying to run the app with docker in Visual Studio 2015(with Docker Tools installed), but get the
following error?

Is anyone using 2016 server as a VS2015 dev machine?

Severity Code Description Project File Line Suppression State


Error MSB4018 The "PrepareForLaunch" task failed unexpectedly.
Microsoft.DotNet.Docker.CommandLineClientException: Creating network "webapplication1_default" with
the default driver
HNS failed with error : The parameter is incorrect.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.DotNet.Docker.BuildTasks.PrepareForLaunch.<ExecuteAsync>d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)
at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
C:\Projects\WebApplication1\src\WebApplication1\WebApplication1.xproj C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing\ImportAfter\Microsoft.
DotNet.Docker.targets 70

 Reply

Collin
January 17, 2017 at 11:27 am

bora, Did you ever solve this? I've had problem after problem on Windows 8, which isn't supported
by Docker for Windows!. It was clunky with RC2 but it all worked at least.

I can only run a docker container with virtualbox if I use the –net=host flag. I wonder if this is
related to the this error.

 Reply

Sergey
November 10, 2016 at 2:29 pm

I try to install windows service in a docker container.


I use microsoft/windowsservercore image and install service using powershell command:
New-Service -Name 'Service-Name' -StartupType Automatic -BinaryPathName 'c:\win-
service\Service.exe'. Service was installed but doesn't start.
I try to start service manualy (docker exec -> start-service) but got error:
Service 'Service-Name' cannot be started due to the following error: Cannot start service Service-Name
on computer '.'.

 Reply

Paul
November 18, 2016 at 5:54 am

Hi Michael,

I fell at the last hurdle I ran the command

docker-compose -f .\docker-compose.windows.yml up

But got the following error when it tried to reset the sa login

db_1 | VERBOSE: Changing SA login credentials


web_1 |
web_1 | Unhandled Exception: System.AggregateException: One or more errors occurred. (Login failed for
user 'sa'.) —>
System.Data.SqlClient.SqlException: Login failed for user 'sa'.
web_1 | at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity,
SqlConnectionStri
ng connectionOptions, Object providerInfo, Boolean redirectedUserInstance, SqlConnectionString
userConnectionOptions, Se
ssionData reconnectSessionData, Boolean applyTransientFaultHandling)
web_1 | at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, DbConnectionPool
Key poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection,
DbConnectionOptions use
rOptions)
web_1 | at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
pool, DbConnection o
wningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions
userOptions)
web_1 | at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject,
DbConnectionOptions use
rOptions, DbConnectionInternal oldConnection)
web_1 | at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject, DbConnectionOption
s userOptions, DbConnectionInternal oldConnection)
web_1 | at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject, UInt32 waitForMulti
pleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions
userOptions, DbConnectionInt
ernal& connection)
web_1 | at System.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
web_1 | at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
web_1 | at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.<OpenAsync>d__31.MoveNext()
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
web_1 | at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
web_1 | at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.
<>c__DisplayClass13_0.<<ExistsAsy
nc>b__0>d.MoveNext()
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.
<>c__DisplayClass13_0.<<ExistsAsy
nc>b__0>d.MoveNext()
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
web_1 | at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
web_1 | at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.
<ExecuteAsync>d__6`2.MoveNext()
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
web_1 | at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
web_1 | at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.
<EnsureCreatedAsync>d__32.MoveNext()
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
web_1 | at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
web_1 | at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
web_1 | at MusicStore.Models.SampleData.<InitializeMusicStoreDatabaseAsync>d__3.MoveNext()
web_1 | — End of inner exception stack trace —
web_1 | at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
web_1 | at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken
cancellationToken)
web_1 | at System.Threading.Tasks.Task.Wait()
web_1 | at MusicStore.Startup.Configure(IApplicationBuilder app)
web_1 | at MusicStore.Startup.ConfigureProduction(IApplicationBuilder app, ILoggerFactory
loggerFactory)
web_1 | — End of stack trace from previous location where exception was thrown —
web_1 | at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
web_1 | at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
web_1 | at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
web_1 | at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
web_1 | at MusicStore.Standalone.Program.Main(String[] args)
db_1 | VERBOSE: Started SQL Server.
musicstore_web_1 exited with code 1

No idea what to do here? Any ideas?

 Reply

Ken Rider
November 23, 2016 at 12:52 pm

I'm getting the same error.

 Reply

eilz
February 26, 2017 at 8:11 am

I get these errors also, is there any update, did anyone get around them?

 Reply
Michael Friis
February 27, 2017 at 5:55 pm

I've pushed a bunch of updates to the MusicStore app recently to add healthchecks and make
startup more reliable: https://github.com/friism/MusicStore

 Reply

Mike
November 25, 2016 at 2:01 am

When I try and run the above commands I see:

PS C:\Windows\system32> Install-Module -Name DockerMsftProvider -Force


PackageManagement\Install-Package : No match was found for the specified search criteria and
module name
'DockerMsftProvider'. Try Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1661 char:21
+ … $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package],
Ex
ception
+ FullyQualifiedErrorId :
NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Windows\system32> Install-Package -Name docker -ProviderName DockerMsftProvider -Force


Install-Package : Unable to find package providers (DockerMsftProvider).
At line:1 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package], E
xception
+ FullyQualifiedErrorId :
UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

I suspect it is the proxy blocking but cannot access it to check. Is it possible to do this behind a very
strict proxy? An alternative download location or manual install?

 Reply

Theeba Krishnan
July 18, 2017 at 5:49 am

I am getting the same error. Could you update?

 Reply

robertolabarca
November 25, 2016 at 5:34 am

pls help me.

.docker. — install in windows 10 A


.Internet. — NOT
.DVD windows 2016 — OK

PLS:

How to create windows base image. ?

 Reply

Ofer
November 26, 2016 at 3:12 pm

When running "docker pull microsoft/windowsservercore" , where are the files going to?

I do not see anything in the folder I ran the command.

 Reply

Michael Friis
February 27, 2017 at 5:56 pm

They go to C:\programdata\docker
You can see images on your machine with `docker images`

 Reply

Brad Jensen
November 29, 2016 at 2:37 pm

So does this mean I can make a windows server 2016 container with windows deduplication in it, and
then run that container on windows 10?

 Reply

Zonciu Liang
December 1, 2016 at 11:47 am

Hello, I'm wondering how to add registry mirror on windows server 2016?

 Reply

Pedro Alvarez
December 15, 2016 at 6:18 am

Great post! Thank you. Running all accordingly

 Reply

Jeremy
December 20, 2016 at 2:57 pm

I'd love to see a demo of deploying to a remote windows 2016 server. Also, if a database were part of a
container package (e.g. service a = webapi + database), how would you handle the distribution/sharing
of the data file?

 Reply

Michael Friis
February 27, 2017 at 6:02 pm

There are several good ways to secure and connect to remote Windows Docker hosts. Personally, I
run sshd on Windows and tunnel the Docker connection over SSH. Details here:
https://github.com/friism/ec2-windows-packer-ssh

Here are other approaches: http://dille.name/blog/2016/11/08/using-a-microsoft-ca-to-secure-


docker/

To answer your 2nd question, check out this lab:


https://github.com/docker/labs/blob/master/windows/modernize-traditional-apps/modernize-
aspnet/README.md

 Reply

Ramu
January 8, 2017 at 10:25 pm

Hi,

When I run "docker-compose -f .\docker-compose.windows.yml build" I get a whole heap of errors and
exists,

ERROR: Service 'web' failed to build: The command 'powershell -Command $ErrorActionPreference =
'Stop'; dotnet build .\samples\MusicStore.Standalone' returned a non-zero
code: 1
..
..
..

ERROR: Service 'web' failed to build: The command 'powershell -Command $ErrorActionPreference =
'Stop'; dotnet build .\samples\MusicStore.Standalone' returned a non-zero
code: 1

Any ideas?
 Reply

Michael Friis
February 27, 2017 at 6:02 pm

Please post more details or ask on the Docker Forums or on Stackoverflow

 Reply

osv
January 10, 2017 at 9:57 pm

docker for windows can't be installed on Windows 2016 it is just possible on Windows 10.
Is there a way of running windows and linux based containers on Windows 2016?

 Reply

Estanislao
January 24, 2017 at 6:10 am

Containers share host OS. In windows 2016 you will be able to run windows 2016 based containers.
Or you can start a linux VM and run your container on it.

 Reply

Estanislao
January 24, 2017 at 6:19 am

As i understand, containers share host OS. In windows 2016 you will be able to run windows 2016
based containers. Or you can start a linux VM and run your container on it.

 Reply

jfoliveira
January 16, 2017 at 3:10 am

Hi Michael,

Could you update your tutorial to use another sample project other than the `MusicStore`. The
MusicStore project is broken as already mentioned here – https://github.com/docker/labs/issues/144 –
therefore it gets hard for beginners in Docker for Windows to actually follow your step by step.

Your article was published with good intention but unfortunately, at the time of this writing on 16-Jan-
2017, it's not being a fully working tutorial.

Thanks!

 Reply

Michael Friis
February 27, 2017 at 6:04 pm

I've fixed MusicStore, please try again: https://github.com/friism/MusicStore

I've also sent a PR to add unit tests: https://github.com/aspnet/MusicStore/pull/749

Here's another lab that you can try:


https://github.com/docker/labs/blob/master/windows/modernize-traditional-apps/modernize-
aspnet/README.md

 Reply

sagar
February 27, 2017 at 6:24 pm

Hello sir ,

When i run .exe application on windows container at that time i am getting below errors .
Docker\Resources\bin\docker.exe: Error response from daemon: container
7da4b32f71a7a0746aa472ae7c20f677ca1153cb75e05b6140a4fd8a758f​​120f encountered an error during
CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra
info: {"ApplicationName":"","CommandLine":"name.exe/bin / bin/name.exe input1
output","User":"","WorkingDirectory":"C:\\","Environment":{}​​,"EmulateConsole":fa​​lse,"CreateStdInPipe​​
":true,"CreateStdOut​​Pipe":true,"CreateSt​​dErrPipe"

 Reply

sagar
February 27, 2017 at 6:25 pm

here is my docker file


—————————-
FROM microsoft/nanoserver
MAINTAINER [email protected]
COPY result_analysis.exe /bin/
ENTRYPOINT ["result_analysis.exe/bin"]
CMD ["/bin/result_analysis.exe", "input1", "output"]

 Reply

Tim
March 6, 2017 at 1:40 am

Hi,
well written and interesting.

I´m curious if this would work with an ESXi Server running vSphere 6.5 (Integrated Container) as well.

You don´t know this by chance right? ^^

As far as I know the vSphere Container get deployed with a Linux Kernel as base preventing clean
Installations of Windows in these.

Or do you by any chance know a discussion platform for these topics?

I can´t find anything else then reddit.

 Reply

Neil Devadasan
March 7, 2017 at 8:32 am

Thank you for the post. I am learning a lot by practicing these instructions.

When I run the docker-compose command I get this ERROR.

PS C:\musicstore> docker-compose -f .\docker-compose.windows.yml build


ERROR: The Compose file '.\.\docker-compose.windows.yml' is invalid because:
services.web.depends_on contains an invalid type, it should be an array
PS C:\musicstore>

The docker-compose.windows.yml looks like this when I downloaded from github.

version: '2.1'
services:
db:
image: microsoft/mssql-server-windows-developer
environment:
sa_password: "Password1"
ACCEPT_EULA: "Y"
ports:
– "1433:1433" # REMARK: This is currently required, needs investigation
healthcheck:
test: [ "CMD", "sqlcmd", "-U", "sa", "-P", "Password1", "-Q", "select 1" ]
interval: 1s
retries: 20
web:
build:
context: .
dockerfile: Dockerfile.windows
environment:
– "Data:DefaultConnection:ConnectionString=Server=db,1433;Database=MusicStore;User
Id=sa;Password=Password1;MultipleActiveResultSets=True"
depends_on:
db:
condition: service_healthy
ports:
– "5000:5000"

networks:
default:
external:
name: nat
Any insight?

Thanks

 Reply

Michael Friis
March 8, 2017 at 1:22 pm

What version of Docker Compose do you have? Please make sure you have a recent one. The
sample works for me with docker-compose version 1.11.2.

Also consider posting on the forum if you have other questions:


https://forums.docker.com/c/docker-for-windows/server-2016

 Reply

Lea Abrugena
April 11, 2017 at 1:47 am

Hi Michael,

I tried this on my Windows 10 machine

Dockerfile
From microsoft/windowsservercore
CMD ["echo", "Hello World"]

Result:
PS C:\FSD\Docker\Trial1> docker build -t lea/leatest .
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM microsoft/windowsservercore
latest: Pulling from microsoft/windowsservercore
3889bb8d808b: Pulling fs layer
503d87f3196a: Downloading
image operating system "windows" cannot be used on this platform

Please help. Thanks!

 Reply

Michael Friis
May 15, 2017 at 7:32 am

You have to switch to Docker Windows Container mode. Use the whale icon in the sys-tray.

 Reply

Michael Curran
April 24, 2017 at 1:46 pm

Running into this issue, and yes I am in a 64-bit PS shell , the Install-Module works fine — the Install-
Package does not (turned off FW just in case it was in the way).

PS C:\WINDOWS\system32> Install-Package -Name docker -ProviderName DockerMsftProvider -Force


Install-Package : The term 'Get-WindowsFeature' is not recognized as the name of a cmdlet, function,
script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try
again.
At line:1 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package],
Exception
+ FullyQualifiedErrorId : FailedToDownload,Install-
Package,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallP
ackage

 Reply

Michael Friis
May 15, 2017 at 7:37 am

If you're on Windows 10, I recommend just installing Docker for Windows.


 Reply

Daniel Weicht
April 27, 2017 at 5:27 am

I have installed Docker in Windows Server 2016 and I am having the following issue.

The daemon.json file has not been installed and I want to change the path directory from C to D. My
question is, can I simply create a daemon.sjon file under the following path "C:\Program Files\Docker"
and then save the file? Additionally, will the following be enough to Point the D drive
{
"graph": "D:\\docker"
}

Thank you very much in advance.

Best regards,
Daniel

 Reply

Michael Friis
May 15, 2017 at 7:46 am

The location of the config file is `c:\programdata\docker`

You can also change this with `dockerd`:

net stop docker


dockerd –unregister-service
dockerd –register-service -g D:\docker
net start docker

 Reply

Daniel Weicht
June 7, 2017 at 1:30 am

Hi Michael,

Thank you very much for your response. It worked like a charm :).

Regards,
Daniel

 Reply

build your own PC


May 3, 2017 at 2:41 am

nice article thanks for posting this article

 Reply

Phill
May 10, 2017 at 4:20 am

Hi Michael,

I am using a 2016 datacentre server in Azure.


I have followed your guide and all is installed after a few tweeks, the containers are created and i have
used the latest release of all softwares, when i try to open the music store in a web browser i get the
below error.

C:\MusicStore>docker-compose -f .\docker-compose.windows.yml up
Starting musicstore_db_1
Starting musicstore_web_1
Attaching to musicstore_db_1, musicstore_web_1
db_1 | VERBOSE: Starting SQL Server
db_1 | VERBOSE: Changing SA login credentials
db_1 | VERBOSE: Started SQL Server.
web_1 | C:\Users\ContainerAdministrator\.nuget\packages\internal.aspnetcore.sdk\1.0.1-rc2-
15218\build\Git.targets(15,5): warning : Unable to determine active git branch.
[C:\MusicStore\samples\MusicStore\MusicStore.csproj]
web_1 | C:\Users\ContainerAdministrator\.nuget\packages\internal.aspnetcore.sdk\1.0.1-rc2-
15218\build\Git.targets(32,5): warning : Property 'CommitHash' was not set
[C:\MusicStore\samples\MusicStore\MusicStore.csproj]
web_1 | warn: Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator[1]
web_1 | No type was specified for the decimal column 'Price' on entity type 'Album'. This will cause
values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the
SQL server column type that can accomadate all the values using 'ForSqlServerHasColumnType()'. To
configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id
'SqlServerEventId.DefaultDecimalTypeWarning'). ConfigureWarnings can be used when overriding the
DbContext.OnConfiguring method or using AddDbContext on the application service provider.
web_1 | warn: Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator[1]
web_1 | No type was specified for the decimal column 'Total' on entity type 'Order'. This will cause values
to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL
server column type that can accomadate all the values using 'ForSqlServerHasColumnType()'. To
configure this warning use the DbContextOptionsBuilder.ConfigureWarnings API (event id
'SqlServerEventId.DefaultDecimalTypeWarning'). ConfigureWarnings can be used when overriding the
DbContext.OnConfiguring method or using AddDbContext on the application service provider.
web_1 | warn: Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator[1]
web_1 | No type was specified for the decimal column 'UnitPrice' on entity type 'OrderDetail'. This will
cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly
specify the SQL server column type that can accomadate all the values using
'ForSqlServerHasColumnType()'. To configure this warning use the
DbContextOptionsBuilder.ConfigureWarnings API (event id
'SqlServerEventId.DefaultDecimalTypeWarning'). ConfigureWarnings can be used when overriding the
DbContext.OnConfiguring method or using AddDbContext on the application service provider.
web_1 | Hosting environment: Production
web_1 | Content root path: C:\MusicStore\samples\MusicStore
web_1 | Now listening on: http://0.0.0.0:5000
web_1 | Application started. Press Ctrl+C to shut down.
db_1 |
db_1 | TimeGenerated EntryType Message
db_1 | ————- ——— ——-
db_1 | 5/10/2017 11:50:18 AM Information None
db_1 | 5/10/2017 11:50:40 AM Information Using 'xplog70.dll' version '2015.130.1601…
db_1 | 5/10/2017 11:50:40 AM Information Attempting to load library 'xplog70.dll' i…
web_1 | fail: Microsoft.AspNetCore.Server.Kestrel[0]
web_1 | UbReadCb
web_1 | System.MissingMethodException: Method not found:
'System.IO.Pipelines.ReadableBufferAwaitable System.IO.Pipelines.IPipeReader.ReadAsync()'.
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketOutput.<StartWrites>d__27.MoveNext()
web_1 | at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine]
(TStateMachine& stateMachine)
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketOutput.StartWrites()
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketOutput..ctor(IPipe pipe, KestrelThread
thread, UvStreamHandle socket, Connection connection, String connectionId, IKestrelTrace log)
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Connection..ctor(ListenerContext context,
UvStreamHandle socket)
web_1 | at
Microsoft.AspNetCore.Server.Kestrel.Internal.Http.ListenerSecondary.ReadStartCallback(UvStreamHandl
e handle, Int32 status)
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvStreamHandle.UvReadCb(IntPtr
handle, Int32 status, uv_buf_t& buf)
web_1 |
web_1 | Unhandled Exception: System.AggregateException: An error occurred while writing to logger(s).
(The collection has been marked as complete with regards to additions.) —>
System.InvalidOperationException: The collection has been marked as complete with regards to
additions.
web_1 | at System.Collections.Concurrent.BlockingCollection`1.TryAddWithNoTimeValidation(T item, Int32
millisecondsTimeout, CancellationToken cancellationToken)
web_1 | at
Microsoft.Extensions.Logging.Console.Internal.ConsoleLoggerProcessor.EnqueueMessage(LogMessage
Entry message)
web_1 | at Microsoft.Extensions.Logging.Console.ConsoleLogger.WriteMessage(LogLevel logLevel, String
logName, Int32 eventId, String message, Exception exception)
web_1 | at Microsoft.Extensions.Logging.Console.ConsoleLogger.Log[TState](LogLevel logLevel, EventId
eventId, TState state, Exception exception, Func`3 formatter)
web_1 | at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState
state, Exception exception, Func`3 formatter)
web_1 | — End of inner exception stack trace —
web_1 | at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState
state, Exception exception, Func`3 formatter)
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelTrace.Log[TState](LogLevel logLevel,
EventId eventId, TState state, Exception exception, Func`3 formatter)
web_1 | at Microsoft.Extensions.Logging.LoggerExtensions.LogCritical(ILogger logger, String message,
Object[] args)
web_1 | at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.Dispose()
web_1 | at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Dispose()
web_1 | at Microsoft.Extensions.DependencyInjection.ServiceProvider.Dispose()
web_1 | at Microsoft.AspNetCore.Hosting.Internal.WebHost.Dispose()
web_1 | at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken
token, String shutdownMessage)
web_1 | at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
web_1 | at MusicStore.Program.Main(String[] args) in C:\MusicStore\samples\MusicStore\Program.cs:line
52
musicstore_web_1 exited with code 1

 Reply

Phill
May 10, 2017 at 4:29 am

Hi Michael,

This might be my bad, i used your commands in command not powershell, will update when
complete.

 Reply

Michael Friis
May 15, 2017 at 7:51 am

Cool, let me know how it goes – if you can't get this working, we're also maintaining an up-to-
date sample here: https://github.com/dockersamples/dotnet-musicstore

 Reply

JCampbell
May 20, 2017 at 9:15 am

Hi,

I'm trying to build the Musicstore application in Powershell and I'm getting the following:

PS C:\Users\jc\Musicstore> docker-compose -f .\docker-compose.windows.yml build


docker-compose : Traceback (most recent call last):
At line:1 char:1
+ docker-compose -f .\docker-compose.windows.yml build
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

File "<string>", line 3, in <module>


File "compose\cli\main.py", line 64, in main
File "compose\cli\main.py", line 113, in perform_command
File "compose\cli\command.py", line 36, in project_from_options
File "compose\cli\command.py", line 103, in get_project
File "compose\config\config.py", line 316, in load
File "compose\config\config.py", line 467, in process_config_file
File "compose\config\validation.py", line 363, in validate_against_config_schema
File "compose\config\validation.py", line 393, in load_jsonschema
IOError: [Errno 2] No such file or directory:
u'C:\\Users\\jc\\AppData\\Local\\Temp\\2\\_MEI18~1\\compose\\config\\config_schema_v3.0.json'
docker-compose returned -1

When I check Windows Explorer (with hidden files showing) the _MEI18~1 folder doesn't exist.

Note that I'd had a github error on the previous step (git clone https://github.com/friism/Musicstore)
though I read this wasn't a true error – just github writing to stderr when it should've written to stdout
(https://github.com/dahlbyk/posh-git/issues/109). And the MusicStore folder seemed to be created ok.

Thanks,
John
PS I'm happy to post elsewhere if this is a docker issue and not a tutorial issue.

 Reply

Rene
June 19, 2017 at 7:31 am

Hi John, in case you could not resolve this meanwhile or for anyone else having this problem:
Looks like a faulty and/or outdated docker-compose executable to me. I had the same error
following the installation instructions from training.docker.com where it referenced a docker-
compose executable from bintray.com (docker-compose version 1.9.0dev, build 466ebb6).
The docker docs referenced https://github.com/docker/compose/releases so I tried with a current
docker-compose (docker-compose version 1.13.0, build 1719ceb8) and got it working just fine.

 Reply

Aslam
May 22, 2017 at 3:45 am

I am trying to start a container on Win 2016 machine and getting below error –

PS C:\Windows\system32> docker run -d –name myFirstIISApp -p 80:80 microsoft/iis


9273be91cab3d36bfe6cd2ca38b5ec29907b631ddbe3440bbcdb4003d187683b
C:\Program Files\Docker\docker.exe: Error response from daemon: container
9273be91cab3d36bfe6cd2ca38b5ec29907b631ddbe344
0bbcdb4003d187683b encountered an error during Start: failure in a Windows system call: This
operation returned because
the timeout period expired. (0x5b4).

 Reply
saurabh jain
June 6, 2017 at 9:52 pm

Hello i have a container id that runs my app on my local pc after getting docke ip for using this
command :-
docker inspect –format="{{.NetworkSettings.Networks.nat.IPAddress}}" helloimagesdockcont

when i tried to run this ip another pc it not executed means i need to expose my containe ip with my
local network what i need to do my pc havinh windows 10 configuration with docker latest version

i have tried satic ip rule as well as open firewall using netsh command but still the problem noit resolved
please help!!!

 Reply

Theeba Krishnan
July 18, 2017 at 5:50 am

When starting docker service , getting below error

"fatal: Error starting daemon: Error initializing network controller: Error creating default network: HNS
failed with error : The object already exists."

Your help is really appreciated!!

 Reply

Frank
August 3, 2017 at 1:12 am

I tried to setup the development environment in windows server 2016 with Visual Studio 2017, I got the
same error, any solution for this? I know MS recommends development should be on Windows 10 while
testing/prod environment should be on Windows server 2016, but I only have windows server 2016, no
windows 10.

1>docker-compose -f "C:\Users\server_admin\Documents\Visual Studio


2017\Projects\WebApplication4\docker-compose.yml" -f "C:\Users\server_admin\Documents\Visual
Studio 2017\Projects\WebApplication4\docker-compose.override.yml" -f
"C:\Users\server_admin\Documents\Visual Studio 2017\Projects\WebApplication4\docker-
compose.vs.release.yml" -p dockercompose4219315891 up -d –no-build
1>Creating network "dockercompose4219315891_default" with the default driver
1>HNS failed with error : The parameter is incorrect.
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: The "PrepareForLaunch" task failed unexpectedly.
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: Microsoft.DotNet.Docker.CommandLineClientException: Creating
network "dockercompose4219315891_default" with the default driver
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: HNS failed with error : The parameter is incorrect. .
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018:
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: For more troubleshooting information, go to
http://aka.ms/DockerToolsTroubleshooting —> Microsoft.DotNet.Docker.CommandLineClientException:
Creating network "dockercompose4219315891_default" with the default driver
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: HNS failed with error : The parameter is incorrect.
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at Microsoft.DotNet.Docker.DockerComposeClient.
<ExecuteAsync>d__18.MoveNext()
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: — End of inner exception stack trace —
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at Microsoft.DotNet.Docker.DockerComposeClient.
<ExecuteAsync>d__18.MoveNext()
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: — End of stack trace from previous location where exception was
thrown —
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at Microsoft.DotNet.Docker.DockerWorkspace.
<PrepareForLaunchAsync>d__14.MoveNext()
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: — End of stack trace from previous location where exception was
thrown —
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute()
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.C
ompose.targets(192,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.
<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "docker-compose.dcproj" — FAILED.

 Reply

Alagesan Pandy
August 3, 2017 at 7:09 am

Below is the error I get during the docker-compose build at the step dotnet publish –

Models\MusicStoreContext.cs(6,36): error CS0246: The type or namespace name 'IdentityUser' could not
be found (are you missing a using directive or an assembly reference?)
[C:\app\samples\MusicStore\MusicStore.csproj]
Models\MusicStoreContext.cs(8,18): error CS0311: The type 'MusicStore.Models.ApplicationUser' cannot
be used as type parameter 'TUser' in the generic type or method 'IdentityDbContext<TUser>'. There is no
implicit reference conversion from 'MusicStore.Models.ApplicationUser' to
'Microsoft.AspNetCore.Identity.IdentityUser'. [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\Facebook\TestFacebookEvents.cs(50,62): error CS0246: The type or namespace
name 'OAuthRedirectToAuthorizationContext' could not be found (are you missing a using directive or
an assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\Google\TestGoogleEvents.cs(50,62): error CS0246: The type or namespace name
'OAuthRedirectToAuthorizationContext' could not be found (are you missing a using directive or an
assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\MicrosoftAccount\TestMicrosoftAccountEvents.cs(51,62): error CS0246: The type or
namespace name 'OAuthRedirectToAuthorizationContext' could not be found (are you missing a using
directive or an assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\Twitter\TestTwitterEvents.cs(44,62): error CS0246: The type or namespace name
'TwitterRedirectToAuthorizationEndpointContext' could not be found (are you missing a using directive
or an assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ERROR: Service 'web' failed to build: The command 'powershell -Command $ErrorActionPreference =
'Stop'; $ProgressPreference = 'SilentlyContinue'; dotnet publish –output /out –configuration Release –
framework netcoreapp2.0 –runtime win10-x64 .\samples\MusicStore' returned a non-zero code: 1

Did anyone face this problem?

 Reply

Roger Champagne
September 18, 2017 at 8:43 am

Alagesan, I am getting the same error – Step 12/18. Running on Windows Server 2016 Standard
(inside a VMWare VM, don't know if this is relevant), Windows updated as of this morning. Using
Docker Enterprise Edition Basic installed via Powershell.

 Reply

Roger Champagne
September 18, 2017 at 1:46 pm

Was using docker-compose version 1.16.0, and have been told that there are issues with recent
versions of this tool. I rolled back to 1.11.2 to no avail.

There seems to be a missing using directive in MusicStore.Models. Visual Studio suggests adding
"using Microsoft.AspNetCore.Identity;", but when I fix it, then there are other compilation errors in
the mocks in the "ForTesting" subfolders.

 Reply

fosu
November 1, 2017 at 1:43 am

Hi Michael

when doing the docker-compose cmd at 12/18,there is a error,how could I fix it?

—> c952057551cf
Step 11/18 : ADD samples samples
—> 1e662eb0a9c0
Step 12/18 : RUN dotnet publish –output /out –configuration Release –framework netcoreapp2.0 –
runtime win10-x64 .\samples\MusicStore
—> Running in 72bb57b92619
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Models\MusicStoreContext.cs(6,36): error CS0246: The type or namespace name 'IdentityUser' could not
be found (are you missing a using directive or an assembly reference?)
[C:\app\samples\MusicStore\MusicStore.csproj]
Models\MusicStoreContext.cs(8,18): error CS0311: The type 'MusicStore.Models.ApplicationUser' cannot
be used as type parameter 'TUser' in the generic type or method 'IdentityDbContext<TUser>'. There is no
implicit reference conversion from 'MusicStore.Models.ApplicationUser' to
'Microsoft.AspNetCore.Identity.IdentityUser'. [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\Facebook\TestFacebookEvents.cs(50,62): error CS0246: The type or namespace
name 'OAuthRedirectToAuthorizationContext' could not be found (are you missing a using directive or
an assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\Google\TestGoogleEvents.cs(50,62): error CS0246: The type or namespace name
'OAuthRedirectToAuthorizationContext' could not be found (are you missing a using directive or an
assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\MicrosoftAccount\TestMicrosoftAccountEvents.cs(51,62): error CS0246: The type or
namespace name 'OAuthRedirectToAuthorizationContext' could not be found (are you missing a using
directive or an assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ForTesting\Mocks\Twitter\TestTwitterEvents.cs(44,62): error CS0246: The type or namespace name
'TwitterRedirectToAuthorizationEndpointContext' could not be found (are you missing a using directive
or an assembly reference?) [C:\app\samples\MusicStore\MusicStore.csproj]
ERROR: Service 'web' failed to build: The command 'powershell -Command $ErrorActionPreference =
'Stop'; $ProgressPreference = 'SilentlyContinue'; dotnet publish –output /out –configuration Release –
framework netcoreapp2.0 –runtime win10-x64 .\samples\MusicStore' returned a non-zero code: 1

 Reply

Prem
December 12, 2017 at 9:06 pm

Hi Team –

Can we install Docker or Docker Toolbox in windows with Windows Kernel. Because my requirement is to
install Windows 2012 using docker and install our application and make sure all services are working
when Docker Container is running.

Below are my findings and steps i tried during my research.

1. Docker on Windows supports only on Windows 2016.

We don't have windows 2016 so we could not try this option.

2. Installed Docker ToolBox in Windows 2010/2012 but Server is showing as OS/Arch: linux/amd64. So i
was not able to install any Windows related OS.

Can we have any other options to install Docker Toolbox with OS/Arch showing as Windows so that we
can install Windows operation system on top of it ?

Thank you in Advance for your help.

Thank you
Prem

 Reply

Sampath
January 2, 2018 at 9:44 pm

Can anyone help me, how to pull postgreSQL image from docker…. I am getting lot of linux based
images of postgreSQL.. I want postgreSQL image for windows server platform…

If i am using a "docker pull postgres" command below is the error am getting.


PS C:\Users\Administrator> docker pull postgres
Using default tag: latest
latest: Pulling from library/postgres
no matching manifest for windows/amd64 in the manifest list entries

 Reply

Leave a Reply
Your name (required)

Your name

Your email address(required, but will not be published)

Your email address

Your website if you have one (not required)

Your website url

Your comment

Your comment

Post comment

Related Posts

Welcome Canonical to Docker Docker Compose for Amazon ECS Apple Silicon M1 Chips and
Hub and the Docker Verified Now Available Docker
Publisher Program By Ben De St Paer-Gotch November 19 By Ben De St Paer-Gotch November 16
By Matt Carter November 24 2020 2020 2020

Why Docker? Products Developers Company

What is a Container Getting started About Us


Product Offerings Play with Docker Blog
Docker Desktop Community Customers
Docker Hub Open Source Partners
Docker Product Roadmap Docs Newsroom
Docker Product Roadmap Virtual Events
Features Birthday Challenge Newsletter
Container Runtime Careers
Developer Tools Contact Us
Docker App Swag Store
Kubernetes

Pricing
FAQ

© 2020 Docker Inc. All rights reserved | Terms of Service | Privacy | Legal

You might also like