I'm trying to deploy portainer to my local docker. I'm running the Docker CE 18.0.6.0 version on Windows 10. I tried to follow the steps from these two pages:
Portainer-Deployment
Tutorial: Portainer for local Docker environments on Windows
10!
But all the times I have tried to run the following command:
docker run -d -p 9000:9000 --name portainer --restart always -v portainer_data:/data portainer/portainer -H tcp://10.0.75.1:2375
Docker responds always with the same message:
Error response from daemon: invalid volume specification:
'portainer_data:/data'
I created the volume using this command:
docker volume create portainer_data
Any idea what could be?
The path syntax you used only works for Linux containers since Linux environments only have a single root to their filesystem tree. To run portainer container in a native Windows container, the syntax is:
docker run -d -p 9000:9000 --name portainer --restart always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -v C:\ProgramData\Portainer:C:\data portainer/portainer
This comes from the deployment documentation.
Related
I just installed Portainer CE by following Docker on Windows WSL / Docker Desktop section as shown below:
Open a terminal and run the following command:
create portainer_data
And then:
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always
-v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Then login to the system via http://localhost:9000 without any problem (also define admin pass).
On the other hand, there is an additional section just below the second command as shown below:
Portainer Agent Only Deployment
Run the following command to deploy the Agent in your Docker host.
docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent
Is there any need to use that command and what is the benefit of Portainer Agent exactly? What is Portainer Server vs Agent Only Deployment?
I have tried executing below command to run portainer.
In Native Windows containers. Windows Server 2016 Datacenter.
$ docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v \.\pipe\docker_engine:\.\pipe\docker_engine -v C:\ProgramData\Portainer:C:\data portainer/portainer
This is the error I am getting, "no matching manifest for unknown in the manifest list entries."
Any idea?
Hi pl run docker pull portainer/portainer and see if it runs successfully. Hope docker service port (default 2375) is allowed on windows firewall
I installed Mosquitto broker with Docker on Raspbian this way:
docker pull eclipse-mosquitto
docker run -d -p 1883:1883 -p 9001:9001 --name=mosquitto eclipse-mosquitto --restart=always
When I reboot the Raspberry, the container seems that is not running and I cannot connect to it. If I try to run it again I get:
docker: Error response from daemon: Conflict. The container name
"/mosquitto" is already in use by container
"3187ab53a3a2067b9d6ce0sa647a8d90cb52485f5540ca4eacad1c4e662ffa9d". You have
to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
So I need to remove it
docker rm -f mosquitto
and restart it again.
What I miss?
Docker Engine prevents two containers from having the same name.
So if you run twice the command like this:
docker run -d -p 1883:1883 -p 9001:9001 --name=mosquitto eclipse-mosquitto
docker stop mosquitto # simulates your reboot
docker run -d -p 1883:1883 -p 9001:9001 --name=mosquitto eclipse-mosquitto
Then the second attempt will fail, as you noticed.
Actually, I guess that you had put the option --restart=always in the wrong place. (More precisely, the arguments given after the image name are not seen as Docker CLI options, they are provided to the entrypoint: docker run [OPTIONS] image-name [ARGUMENTS])
Could you try this (and reboot)?
docker run -d -p 1883:1883 -p 9001:9001 --name=mosquitto --restart=always eclipse-mosquitto
Otherwise, you could just as well do:
docker start eclipse-mosquitto
after a docker stop or a reboot that wouldn't succeed in restarting the container.
I want to run docker inside another docker container. My main container is running in a virtualbox of OS Ubuntu 18.04 which is there on my Windows 10. On trying to run it, it is showing me as:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
How can I resolve this issue?
Yes, you can do this. Check for dind (docker in docker) on docker webpage how to achieve it: https://hub.docker.com/_/docker
Your error indicates that either dockerd in the top level container is not running or you didn't mount docker.sock on the dependent container to communicate with dockerd running on your top-level container.
I am running electric-flow in a docker container in my Ubuntu virtual-box using this docker command: docker run --name efserver --hostname=efserver -d -p 8080:8080 -p 9990:9990 -p 7800:7800 -p 7070:80 -p 443:443 -p 8443:8443 -p 8200:8200 -i -t ecdocker/eflow-ce. Inside this docker container, I want to install and run docker so that my CI/CD pipeline in electric-flow can access and use docker commands.
From your above description, ecdocker/eflow-ce is your CI/CD solution container, and you just want to use docker command in this container, then you did not need dind solution. You can just access to a container's host docker server.
Something like follows:
docker run --privileged --name efserver --hostname=efserver -d -p 8080:8080 -p 9990:9990 -p 7800:7800 -p 7070:80 -p 443:443 -p 8443:8443 -p 8200:8200 -v $(which docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -i -t ecdocker/eflow-ce
Compared to your old command:
Add --privileged
Add -v $(which docker):/usr/bin/docker, then you can use docker client in container.
Add -v /var/run/docker.sock:/var/run/docker.sock, then you can access host's docker daemon using client in container.
My centos version and docker version(install by yum)
Use docker common error in container
My docker run command:
docker run -it -d -u root --name jenkins3 -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker docker.io/jenkins/jenkins
but,its error when I exec docker info in jenkins container
/usr/bin/docker: 2: .: Can't open /etc/sysconfig/docker
Exposing the host's docker socket to your jenkins container will work with
-v /var/run/docker.sock:/var/run/docker.sock
but you will need to have the docker executable installed in your jenkins image via a Dockerfile.
It is likely the example you are looking at is already using a docker image. A quick google search brings up https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ whose example uses a docker image (already has the executable installed):
docker run -v /var/run/docker.sock:/var/run/docker.sock \
-ti docker
Also note from that same post your exact issue with mounting the binary:
Former versions of this post advised to bind-mount the docker binary from the host to the container. This is not reliable anymore, because the Docker Engine is no longer distributed as (almost) static libraries.