sixeyed / docker-on-windows Goto Github PK
View Code? Open in Web Editor NEWCode samples for the book "Docker on Windows"
Home Page: https://www.amazon.com/gp/product/1789617375/
License: Apache License 2.0
Code samples for the book "Docker on Windows"
Home Page: https://www.amazon.com/gp/product/1789617375/
License: Apache License 2.0
Do you think it will be good/viable solution instead of modifying code to accomodate for docker secrets instead have all secret management as part of Entrypoint
dockerfile reference. That is to have logic in Entrypoint to import/modify secrets at container start and update relevant web.config, configuration references. This
RunAs
or any other security aspects of running application since EntryPoint
is executed as ContainerAdminRunning the command:
docker container run -d -P --name healthcheck dockeronwindows/ch03-iis-healthcheck:2e
Container starts and stop in seconds. The log from the docker container log:
_Invoke-WebRequest : Unable to connect to the remote server
At line:1 char:180
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-Content : Cannot find path 'C:\iislog\W3SVC\u_extend1.log' because it does
not exist.
At line:1 char:303
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When trying to run:
docker container run -d -P dockeronwindows/ch03-nerd-dinner-web:2e-v2 from the ch03-nerd-dinner-web directory, the issue occurs:
PS C:\DockerStudy\ch03\ch03-nerd-dinner-web> docker container run -d -P dockeronwindows/ch03-nerd-dinner-web:2e-v2
Unable to find image 'dockeronwindows/ch03-nerd-dinner-web:2e-v2' locally
C:\Program Files\Docker\docker.exe: Error response from daemon: manifest for dockeronwindows/ch03-nerd-dinner-web:2e-v2 not found: manifest unknown: manifest unknown.
See 'C:\Program Files\Docker\docker.exe run --help'._
When trying to run the container ch-03-nerd-dinner-web I'm receiving the error below (the same as the last issue):
PS C:\DockerStudy\ch03\ch03-nerd-dinner-web> docker container logs 596bb08cab53
_Invoke-WebRequest : Unable to connect to the remote server
At line:1 char:180
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get-Content : Cannot find path 'C:\iislog\W3SVC\u_extend1.log' because it does
not exist.
At line:1 char:291
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step 4/16 : RUN nuget restore packages.config -PackagesDirectory ..\packages
---> Running in e3433b4bdf8f
Restoring NuGet package Microsoft.AspNet.WebApi.5.2.3.
Restoring NuGet package Microsoft.AspNet.WebApi.Client.5.2.3.
Restoring NuGet package Microsoft.AspNet.WebApi.Core.5.2.3.
Restoring NuGet package Microsoft.AspNet.WebApi.WebHost.5.2.3.
Restoring NuGet package Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0.
Restoring NuGet package Newtonsoft.Json.6.0.4.
WARNING: Unable to find version '5.2.3' of package 'Microsoft.AspNet.WebApi.Client'.
C:\Users\ContainerAdministrator.nuget\packages: Package 'Microsoft.AspNet.WebApi.Client.5.2.3' is not found on source 'C:\Users\ContainerAdministrator.nuget\packages'.
https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote name could not be resolved: 'api.nuget.org'
Hi,
We have an older application that uses COM+. We managed to create a COM+ application using Powershell but having trouble with creating a component inside it.
Can you provide an example?
Thanks.
Hi Elton,
In chapter 7 you tell the swarm mode would be available until the release of the book.
I'm trying with the same docker-compose form local but it's not working.
I just want to check if my versions are correct to try this.
Docker: 19.03.2
Windows: Windows Server 2019 Datacenter Version 1809 (OS Build 17763.737)
Thanks.
issue
Use windows nodejs image (server core in 1803/1809) to build html source code in a mount volume(docker volume, host-volume and G driver solution), all build in mount volume are failure when in lerna bootstrap with the same kind of Error "Error: EPERM: operation not permitted, symlink".
Expected behavior
Use windows nodejs image to build source code in a mount volume, npm install successfully
Actual behavior
npm WARN [email protected] requires a peer of zone.js@^0.8.29 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\json-sass\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
Environment Information
Windows Version: windows 10 1809
Docker Desktop Version: 19.03.2
Steps to reproduce the behavior
Hi Elton
I need to change the locale of a Windows Container. I know it requires a reboot of a normal Windows machine or VM. How do I do the same with a Docker Container?
I've tried restart-computer but that produces errors on shutdown so the container can't be restarted.
So how is it done?
I was wondering if there is a book or more materials where someone could get more information about running linux containers on windows server 2019. Couldn't get more info by reading this book. Thanks in advance for any feedback.
Hello,
When i perform the run command as below i get this error.
PS C:\Users\Administrator> docker container run dockeronwindows/ch01-whale:2e
Unable to find image 'dockeronwindows/ch01-whale:2e' locally
2e: Pulling from dockeronwindows/ch01-whale
6a5e981230da: Pulling fs layer
7fe5fc4b6b6d: Pulling fs layer
2a921185b5ca: Pulling fs layer
ce55179130f6: Waiting
docker: open C:\ProgramData\docker\tmp\GetImageBlob786153451: Het systeem kan het opgegeven pad niet vinden.
See 'docker run --help'.
I am running a VM Windows 2019 (1809)
Client: Mirantis Container Runtime
Version: 20.10.9
API version: 1.41
Go version: go1.16.12m2
Git commit: 591094d
Built: 12/21/2021 21:34:30
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Mirantis Container Runtime
Engine:
Version: 20.10.9
API version: 1.41 (minimum version 1.24)
Go version: go1.16.12m2
Git commit: 9b96ce992b
Built: 12/21/2021 21:33:06
OS/Arch: windows/amd64
Experimental: false
btw: In the whale readme the run command states ddocker and not docker.
Thanks
Hi Elton, just heads up, On fresh windows server 2019, if you do not specify an older version of docker EE, like 18, then the install command here fails
And it may be affecting others as well
https://stackoverflow.com/questions/57626342/how-to-install-docker-on-windows-server-2016
I am following your new book. Cheers
Hello,
Thank you for an excellent book. I have been reading and following through your examples and through the standardization that Docker provides, the examples still run as expected.
However, in Ch5, when I run ch05-run-nerd-dinner_part-2.ps1 ( after part-1 ), I noticed that while the reverse-proxy service does run, the transcript indicates some errors.
Log:
1 > time="2021-01-16T18:11:08-08:00" level=error msg="Failed to retrieve information of the docker client and server host: error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running."
2 > time="2021-01-16T18:11:08-08:00" level=error msg="Provider connection error Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).doRequest
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:182
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).sendRequest
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:122
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).get
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:37
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).ServerVersion
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/version.go:12
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1.1
/go/src/github.com/containous/traefik/provider/docker/docker.go:137
github.com/containous/traefik/safe.OperationWithRecover.func1
/go/src/github.com/containous/traefik/safe/routine.go:160
github.com/containous/traefik/vendor/github.com/cenk/backoff.RetryNotify
/go/src/github.com/containous/traefik/vendor/github.com/cenk/backoff/retry.go:37
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1
/go/src/github.com/containous/traefik/provider/docker/docker.go:252
github.com/containous/traefik/safe.(*Pool).GoCtx.func1
/go/src/github.com/containous/traefik/safe/routine.go:62
github.com/containous/traefik/safe.GoWithRecover.func1
/go/src/github.com/containous/traefik/safe/routine.go:142
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1333
error during connect
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).doRequest
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:185
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).sendRequest
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:122
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).get
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:37
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).ServerVersion
/go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/version.go:12
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1.1
/go/src/github.com/containous/traefik/provider/docker/docker.go:137
github.com/containous/traefik/safe.OperationWithRecover.func1
/go/src/github.com/containous/traefik/safe/routine.go:160
github.com/containous/traefik/vendor/github.com/cenk/backoff.RetryNotify
/go/src/github.com/containous/traefik/vendor/github.com/cenk/backoff/retry.go:37
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1
/go/src/github.com/containous/traefik/provider/docker/docker.go:252
github.com/containous/traefik/safe.(*Pool).GoCtx.func1
/go/src/github.com/containous/traefik/safe/routine.go:62
github.com/containous/traefik/safe.GoWithRecover.func1
/go/src/github.com/containous/traefik/safe/routine.go:142
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1333, retrying in 369.950822ms"
Here is my Docker host environment :
Powershell : run as an Administrator, with ExecutionPolicy = RemoteSigned, All.
PC: Windows 10, 2004
Docker Desktop: 3.0.4
Docker Engine: 20.10.2
Tried the following :
2.Substitute sixeyed/traefik:v1.7.8-windowsservercore-ltsc2019 for a newer Traefix traefik:v2.3.7-windowsservercore-1809 failed with error :
2021/01/16 21:13:12 command traefik error: failed to decode configuration from flags: field not found, node: docker
This tells me that I should look at the Dockerfile for sixeyed/traefik:v1.7.8-windowsservercore-ltsc2019 to find out how the --docker flag should be handled.
Unfortunately sixeyed/traefik is a container, not an image and does not have the Dockerfile available for inspection.
Hopefully, you can provide some guidance to get your example working again.
Thanks,
Output is:
Step 6/16 : RUN msbuild Healthcheck.WebApi.csproj /p:OutputPath=c:\out\Healthcheck /p:DeployOnBuild=true /p:VSToolsPath=C:\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath
---> Running in 82394ec8732a
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 12/16/2017 5:35:27 PM.
Project "C:\src\Healthcheck.WebApi\Healthcheck.WebApi.csproj" on node 1 (default targets).
C:\src\Healthcheck.WebApi\Healthcheck.WebApi.csproj(139,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props.
Done Building Project "C:\src\Healthcheck.WebApi\Healthcheck.WebApi.csproj" (default targets) -- FAILED.
Build FAILED.
I've done some research but not got to the bottom of this yet, however this StackOverflow question seems to be related. I can't get the source code to compile locally because of this error but possibly due to not having the right VS2017 components installed. I've run out of time tonight but wanted to get this logged. Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.