Docker will not start automatically after reboot on Windows - windows

I have docker installed on Windows Server 2019 Datacenter.
This is the Docker info:
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:37 2019
OS/Arch: windows/amd64
Experimental: false
I would like to have docker start automatically whenever the server starts, but i consistently get this message at startup:
Service is not running
Docker Desktop service is not running, would you like to start it? Windows will ask you for elevated access.
in order to start docker, i will have to press start manually through the GUI, but i would like to automate this process.
I have already tried:
-Logging in with my account on this machine
-Put docker shortcut at shell:startup folder
Thanks.

I found that using
"net start com.docker.service" before starting the docker.exe process works.

Related

Exposing USB COM serial devices to Docker Windows container

I have a script that I want to run as a container. It depends on a an USB camera to run.
My host is a Windows 10 IoT Enterprise machine. I have tried exposing the COM serial ports of my host through WSL 2 to a Linux container, but exposing COM serial ports through WSL 2 its currently not supported, so my only option is using Windows containers.
I followed the process used in the Microsoft documentation to expose devices (Just mirroring the OS and version from my host which would be 20H2, and using the GUID for COM serial ports)
docker run --isolation=process --device="class/86E0D1E0-8089-11D0-9CE4-08003E301F73" mcr.microsoft.com/windows:20H2
The container is created and runs for a couple seconds, but when connected to the CLI it displays this error: container 5245931c246cc8181221354158bf7ddad64eb5099a493354a68a39d94feed6f0 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)
Docker information:
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:56:41 2021
OS/Arch: windows/amd64
Experimental: false
Any feedback will be appreciated, thanks!

Build or Run docker image error : CreateComputeSystem - Insufficient system resources exist to complete the requested service

i got this error on windows server 2019 standard running docker and no idea how to solve it. Running windows container with process isolation. Memory is always max 40% (32Gb), CPU always below 20% and disks lot of space (250Gb free).
Running an official container like : docker run -d --rm -p 8080:80 --name test mcr.microsoft.com/dotnet/core/samples:aspnetapp
Got this error after extracting phase and start of container :
C:\Program Files\Docker\docker.exe: Error response from daemon: CreateComputeSystem ba698710f7bff4d46dce2ee65453b9da143195770b93cf82f8bb3818fca70174: Insufficient system resources exist to complete the requested service. (extra info: {"SystemType":"Container","Name":"ba698710f7bff4d46dce2ee65453b9da143195770b93cf82f8bb3818fca70174","Owner":"docker","VolumePath":"\\\\?\\Volume{61d19b2c-50e1-4dd5-9257-9c67998f1123}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\ba698710f7bff4d46dce2ee65453b9da143195770b93cf82f8bb3818fca70174","Layers":[{"ID":"05435bc5-50b1-5044-9210-12d7ab180470","Path":"C:\\ProgramData\\docker\\windowsfilter\\84fc4324bf3d2de92b5f9c0a80e238bc3b3f1fdbe0fea13b7a35146069c21663"},{"ID":"3f1c6cd1-b66d-5d8d-aa2e-d11e489b74fe","Path":"C:\\ProgramData\\docker\\windowsfilter\\11d9c87c3490cf087488aaf21a3c88b45c68273ea270c6f850261583715cf241"},{"ID":"655918d6-84bb-5633-8bb2-981f3a29e3c6","Path":"C:\\ProgramData\\docker\\windowsfilter\\1f11a5340a1c13ef658355b9e30f7794ee398fb863105d6e18b48bd8a4687f79"},{"ID":"41893d4a-0704-50df-8f4e-41cad4480d3e","Path":"C:\\ProgramData\\docker\\windowsfilter\\36296cba828c68663184ddd5e75f5084ce59b755fcc9025845fe516782b2e243"},{"ID":"dc4a1317-f05d-5470-847d-d1e4bd029e6d","Path":"C:\\ProgramData\\docker\\windowsfilter\\8293bbc58e2c9c7da089187afd6cbf0e22b1bcb27cadc3e569542e324733ef82"},{"ID":"6f247d11-4160-56dc-9dbe-b40a4b67d151","Path":"C:\\ProgramData\\docker\\windowsfilter\\d9ba1e3f6cffcc5f69e2d2265a7539a0e4aff9b4f8f86e3edc3ff5b4026a584b"},{"ID":"5f54a86d-b6e0-5f1c-977d-dc7bba046d7e","Path":"C:\\ProgramData\\docker\\windowsfilter\\9beb006814b54bda1f7afa7a0f2870a4a970ef624ab6d2bffec4e27f2b749d6e"},{"ID":"03a39db9-584f-5d5b-8bbc-95883aa2af8b","Path":"C:\\ProgramData\\docker\\windowsfilter\\38ad1eb3b36d16eb77e6264daca47fad96080cb9596aa6aeb8c6d269ffbead89"},{"ID":"bffe53fb-2619-5d30-ae46-da6f759a87ed","Path":"C:\\ProgramData\\docker\\windowsfilter\\d4b5eaee9002c7b73dd7a72880c9caa3a39b7ef5c304b19e7c0a732c01b2a4bb"},{"ID":"aaec8c93-d215-59d6-99e2-001f38fa3ee3","Path":"C:\\ProgramData\\docker\\windowsfilter\\34ccac695ab1683cc21309e94c64110476d45b07b69b6956da9e795c31f6b815"}],"HostName":"ba698710f7bf","HvPartition":false,"EndpointList":["9070F572-5CDD-4CCE-8C7E-218F0BA2F221"],"AllowUnqualifiedDNSQuery":true}).
Server: Docker Engine - Enterprise
Engine:
Version: 18.09.11
API version: 1.39 (minimum version 1.24)
Go version: go1.12.12
Git commit: 6112046bc9
Built: 11/13/2019 07:49:53
OS/Arch: windows/amd64
Experimental: false
Go to registry,
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NDIS\IfTypes\24
and set ifUsedNetLuidIndices to 01
and then restart the computer.

Docker pull command fails when launched in Jenkins

I am writing a Jenkins pipeline aimed to pull a docker image from a private registry. At the moment I have an issue in launching the docker pull command, since it fails when launched from Jenkins.
Currently, the Jenkins pipeline works as follow:
takes a set of parameters from user (i.e.: image name and tag)
launches a separate bash script performing the pull operation.
The bash script does two operations:
logs in the registry through the following: echo $pwd | docker login -u$username --password-stdin $registryUrl
pulls the image through the command: docker pull $image:$tag
The login command succeeds, while the pull command replies with:
Error response from daemon: access denied:
no access to Image Load, on collection swarm
At first sight I think that's a matter of user privileges, but running the bash script outside the Jenkins context (as the owner of the jenkins process) it works.
Am I missing any configuration? As an alternative, I tried to implement the Jenkins pipeline using the Docker Jenkins Plugin API, but it fails too.
Final Note
The owner of the Jenkins process is different from the user logging in Docker private registry. May this affect the behavior?
Operating System:
macOS 10.14.6
Docker Version details:
Client: Docker Engine - Community
Version: 19.03.4
API version: 1.40
Go version: go1.12.10
Git commit: 9013bf5
Built: Thu Oct 17 23:44:48 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.4
API version: 1.40 (minimum version 1.12)
Go version: go1.12.10
Git commit: 9013bf5
Built: Thu Oct 17 23:50:38 2019
OS/Arch: linux/amd64
Pipelines have their own commands and tricks to login to dockerhub. For example,
docker.withRegistry('https://registry.hub.docker.com', 'dockerhub-creds') {
docker.image('myteam/secretimage:latest').inside() {
checkout scm
sh './configure && make && make test'
}
}
Here, dockerhub-creds are credentials you should create in Jenkins itself.
This technique is better than echoing password because:
Password will be hidden in build's stdout and from other users who don't have access to credentials
Password is magically mirrored across users, build nodes, docker containers etc and you will not face situation that "execution context is different, nothing works"

Can not pull nanoserver:1903 Docker image

I would like to pull the nanoserver:1903
docker pull mcr.microsoft.com/windows/nanoserver:1903
The command line for this is copied from the Docker Hub,
That page also say, this image is created 2 weeks ago: 05/22/2019
When I execute the pull command I got the error message.
1903: Pulling from windows/nanoserver
no matching manifest for unknown in the manifest list entries
What am I missing?
I am on Windows 10, some additional diag info:
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
Operating System: Windows 10 Pro Version 1809 (OS Build 17763.404)
OSType: windows
Architecture: x86_64
CPUs: 28
Total Memory: 63.69GiB
Debug Mode (client): false
Debug Mode (server): true
Registry: https://index.docker.io/v1/
Experimental: true
First check if your Docker is switched to run Windows containers. Now, check your windows version by typing winver on run. For e.g. in my case it's 1607. Pull the corresponding tag for e.g. docker pull mcr.microsoft.com/windows/nanoserver:1607. Basically, the version/tag of image being pulled must match the version of Windows running on the system.

dotnet core project not running in docker

I just installed docker on windows 10
I can run the following command docker version so docker must be working
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24302
Built: Fri Mar 23 08:31:36 2018
OS/Arch: windows/amd64
Experimental: false
Orchestrator: swarm
If a create a new dotnet core project from within Visual studio the project builds fine and runs the code inside the container. (I think that is the correct terminology)
So, I tried to add an existing project to docker. Basically, all I did was right click on the .sln and added docker support.
But if I try to run the project I get the following error
error during connect: Get https://192.168.99.100:2376/v1.37/version:
dial tcp 192.168.99.100:2376: connectex: A connection attempt failed
because the connected party did not properly respond after a period of
time, or established connection failed because connected host has
failed to respond.
How can I fix it?
I tried running simple commands in PowerShell but that seems to give the same error. (docker version)
how can the new project connect to 192.168.99.100:2376 and not the existing one that I added the dockerfile to?
Open powershell
cd to the directory with the dockerfile
run:
docker build -t myapp .
when that's done run:
docker run --rm -d --name myapp -p 8080:8080 myapp
open browser to localhost:8080

Resources