Error on the Rancher server UI side
[workerPlane] Failed to bring up Worker Plane: Failed to create
[kubelet] container on host [ip-address]: Error response from daemon:
invalid mount config: must use either propagation mode "rslave" or
"rshared" when mount source is within the daemon root, daemon root:
"/var/lib/docker", bind mount source: "/var/lib/docker", propagation:
"rprivate"
Docker Version: Docker version 17.12.1-ce
OS: Centos 7
At the time of writing, 17.03 is the latest version of Docker officially supported by K8S/Rancher, and is the latest version from Centos repositories that will function without this error.
However, if you pull from EPEL, docker-ce-17.12.0 will also work.
Related
I am a beginner at Docker. I need to create two containers for mongo and mongo-express. But, I'm getting an error as error during connect: This error may indicate that the docker daemon is not running.
Then I tried below steps:
I run the cmd as administrator. Then I run the command "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon. It didn't work for me. then I tried with 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon way. Then I enabled hypervisor also. Still, I am getting the same error. When I ran the docker version command in cmd I received the below-mentioned outputs:
Then after I tried with cd "C:\Program Files\Docker\Docker" and ./DockerCli.exe -SwitchDaemon separately.
docker info command gives below mentioned error:
C:\Windows\system32>docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.0)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.0.5)
extension: Manages Docker extensions (Docker Inc., v0.2.17)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.23.0)
Server:
ERROR: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/info": open //./pipe/docker_engine: The system cannot find the file specified.
errors pretty printing info
Did you install the Docker Desktop on your Windows PC? If not please install it and Run it. If you already installed it, please run it first!
Then you can see whether the docker engine is starting or not!
After the docker engine started check whether this error is still there. Most probably error will fix after doing that!
If the docker engine is not started, please uninstall docker and delete everything from Registry.
Press Win+R and %appdata%\Docker to go and delete all the files.
Then reinstall the docker, if better you can install the docker desktop. Because with the docker desktop, the docker provides a whole bundle with it! Then you will be able to install the docker for windows smoothly.
Because this error usually getting when the docker engine is not started. Also, this may happen missing Linux kernel on windows. Both issues will address with the correct installation of the Docker Desktop.
You can check whether you have a docker Linux subsystem running on your windows pc by running the following command on cmd,
wsl -l
If you get a result like this,
C:\Users\gayan>wsl -l
Windows Subsystem for Linux Distributions:
docker-desktop-data (Default)
docker-desktop
Then you are okay and ready to go.
If not, please try to uninstall and install the docker desktop
Make sure you delete the previous registry, To do that press Win+R and type Regedit Then go to HKEY_LOCAL_MACHINE -> SOFTWARE -> Docker Inc and delete that folder.
If still you are getting the same error, try to troubleshoot the docker desktop. you can refer to the docker documentation.
I've installed docker on windows 10 and configured for windows container. I'm not able to switch to linux container. it is throwing some exception.
When I pull hello-world image it is giving "no matching manifest for windows/amd64 10.0.16299 in the manifest list entries" message. What does this error mean? I tried experimental mode too. This solution I found on stack overflow. I've also tried to reinstall docker for windows but no luck.
Can anyone help me in this?
The "no matching manifest" error happens when that particular image could not be found (e.g., openjdk:8 exists but openjdk:69 would cause that error to be thrown because it doesn't exist).
The hello-world image does exist on Docker Hub, but not for certain computers (e.g., your Windows AMD). The alternate hello-world image to be used on such computers is docker/surprise (run docker run --rm -it docker/surprise).
The docs should be updated for this caveat since both docker --version and docker run hello-world is supposed to demonstrate that you've successfully set up Docker. Just know that you should use the docker/surprise image instead in such cases.
This error implies your host machine's OS is not compatible with the OS docker image you are trying to pull. See Windows container version compatibility
For example, if you are running Windows 10 1809 on your host OS, you cannot pull mcr.microsoft.com/windows:1909. However you can of course pull mcr.microsoft.com/windows:1809
e.g. docker run mcr.microsoft.com/windows:1809
or docker-compose up with a docker-compose.yml file:
version: "3"
services:
myWin:
image: mcr.microsoft.com/windows:1809
networks:
- myNet
networks:
myNet:
driver: nat
I think it's related to your actual PC, I mean you might be using an AMD processor.
In my case, I am using Windows Server 2016 on AMD processor. Docker gives Windows Server users another version called Docker Enterprise Engine (EE for short) and for Docker EE users who are on AMD, they should try this:
docker run hello-world:nanoserver-sac2016
Jenkins
In Jenkins I decided to use the remote docker feature.
So I installed docker.io on the linux server and use this pipeline.
node {
stage('Example') {
docker.withServer('tcp://docker.example.org:2375') {
docker.image('stefanscherer/node-windows:10').inside {
sh 'node --version'
}
}
}
}
But this fails with a error message about the volume configuration.
java.io.IOException: Failed to run image 'stefanscherer/node-windows:10'. Error: docker: Error response from daemon: invalid volume specification: '/var/lib/jenkins/workspace/Docker Test:/var/lib/jenkins/workspace/Docker Test:rw,z'.
See 'docker run --help'.
at org.jenkinsci.plugins.docker.workflow.client.DockerClient.run(DockerClient.java:133)
Maybe the problem is that I try to combine a linux Jenkins with a docker Windows?
But I read for this is the experimental option which should allow using Linux containers.
GitLab
GitLab-Runner installed via this guide. https://docs.gitlab.com/runner/install/windows.html
Then I connected it and selected docker as executor.
When I remove the hosts from daemon.json I get this error message.
ERROR: Preparation failed: Error response from daemon: client version 1.18 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version (executor_docker.go:1161:0s)
How to get a version which supports the newer API?
I read an article that GitLab is waiting for LTS EOL (End-of-Life). I think for CentOS or something else.
When I have the hosts set up in daemon.json I get this error message.
ERROR: Preparation failed: error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.18/info: open //./pipe/docker_engine: The system cannot find the file specified. 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. (executor_docker.go:1161:0s)
Thats because the runner can't find Docker because Docker is only listening on the TCP port.
I tried adding //./pipe/docker_engine to the hosts of daemon.json but it didn't work. The docker service is crashing immediately.
Docker
Windows Server 2016
daemon.json
{
"hosts": ["tcp://0.0.0.0:2375"],
"experimental": true
}
Goal
My goal is to build my jobs from (linux) Jenkins and (linux) GitLab on the (windows) Docker.
Problem
Jenkins is not working in general because of some settings maybe or because it tries to mount windows paths?
GitLab is expecting an old API which the docker doesn't offer.
Goal
You are in the right track, distribute your CI pipeline allows easy scalation and containers are the ideal solution for this.
Jenkins
In the Docker Pipeline Jenkins documentation it is explained:
For inside() to work, the Docker server and the Jenkins agent must use
the same filesystem, so that the workspace can be mounted.
So give a try with other command (for instance withRun) and see, in any case, I miss some credentials here. You can also configure a new Jenkins node for Docker and there you can specify the path where the jobs are executed.
GitLab
The GitLab runner issue on Windows is planned to be included in 11.8 release (Feb 2019) as it is described here.
Conclusion
I would go for a Linux installlation if you cannot wait until the new GitLab release and I would add a new Jenkins node for the docker configuration as it is described here.
I am trying to run a Docker image inside a Service Fabric cluster.
This image runs fine on my local machine. However, when I deploy it to either my local cluster or a cluster on Azure Service Fabric, it starts to crash.
I tried running the docker ps command on the machine. It shows a container image running, but after 5s when I run the command again, it shows an empty list.
My application is built using ASP.NET Core 2.0.7 and my container image is microsoft/aspnetcore:2.0.7-nanoserver-1709
I am using the below OS for my cluster:
Offer: WindowsServerSemiAnnual SKU:
Datacenter-Core-1709-with-Containers-smalldisk
I see the below error:
Error event: SourceId='System.Hosting',
Property='CodePackageActivation:Code:EntryPoint'. There was an error
during CodePackage activation.System.Fabric.FabricException
(-2147017731) Failed to start Container.
ContainerName=sf-2-4e0c854d-d2d9-458a-82c5-78da874dc520_6fd774de-4796-4563-ab3f-c3bbb4d49e0c,
ApplicationId=ServiceFabricApplicationType_App2,
ApplicationName=fabric:/ServiceFabricApplication. DockerRequest
returned StatusCode=InternalServerError with
ResponseBody={"message":"container
fb204978704c52917704f1f6985ec9a73c9e76596e7258ff0ffce93c9c5109e0
encountered an error during CreateContainer: failure in a Windows
system call
It's very likely that you're running into this because of a mismatch between the version of Windows inside the image vs the version on the host.
Check out the compatibility list here.
(It specifically mentions your error message.)
To resolve this, you could:
Rebuild the container based on the version of microsoft/nanoserver or microsoft/windowsservercore
If the host is newer, use docker run
--isolation=hyperv ... Run on a different host with the same Windows version
I have installed docker on windows 10.
Docker version:
Docker version 17.09.0-ce, build afdb6d4
I tried to pull latest ubuntu and ubuntu:16.04 using the bellow two commands
docker pull ubuntu
docker pull ubuntu:16.04
But I am getting the below error.
docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
no matching manifest for windows/amd64 in the manifest list entries
So is there any way to fix this issue?
You can't run linux images with a windows daemon.
If you are running Docker for Windows, it gives you the ability to switch between running a Windows Docker daemon and a Linux Docker daemon inside a hyper-v VM.
To run Linux workloads, make sure you have chosen "Switch to Linux Containers" in the Docker for Windows whale icon menu.
please follow the Docker tutorial here
In this case the problem is it requires adding the --experimental flag when starting dockerd.exe.