Mattermost with Docker for Windows error: invalid volume specification - docker

I try to get Mattermost working with Docker for Windows. As mentioned here I executed the following command:
docker run --name mattermost-preview -d --publish 8065:8065 mattermost/mattermost-preview
After pulling and extracting the files, docker exits and throws the following error:
docker.exe: Error response from daemon: Unrecognised volume spec: invalid volume specification: './mattermost-data'.
Running Windows Server 2019 PreRelease 17623 and docker 17.10.0-ee-preview-3

Feedback from our engineers is that while they've never used Docker with Windows, your issue might be Windows related because it can't create a Docker volume (maybe related to the different path syntax between Linux and Windows ?)

Not sure if this will help, but here are the very basic example using volume on Windows Engine.
docker run -it -v C:\Users\Administrator\:C:\Users\public microsoft/nanoserver powershell
Also, you might want to use stable release channel instead of pre-release version of Windows. There are number of changes made, and base images will not be compatible. It is likely that the author of this image built it for Windows stable release.
Maybe, contact support for Mattermost?

Related

Jenkins Docker plugin volume/mount what syntax to use

I have a linux vm on which I installed docker. I have several docker containers with the different programs I have to use. Here's my architecture:
Everything is working fine except for the red box.
What I am trying to do is to dynamically provide a jenkins docker-in-docker agent with the cloud functionality in order to build my docker images and push them to the docker registry I set up.
I have been looking for documentation to create a docker in docker container and I found this:
https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
This article states that in order to avoid problems with my main docker installation I have to create a volume:
-v /var/run/docker.sock:/var/run/docker.sock
I tested my image locally and I have no problem to run
docker run -d -v --name test /var/run/docker.sock:/var/run/docker.sock
docker exec -it test /bin/bash
docker run hello-world
The container is using the linux vm docker installation to build and run the docker images so everything is fine.
However, I face problems when it comes to the jenkins docker cloud configuration.
From what I gather, since the #826 build, the docker jenkins plugin has change its syntax for volumes.
This is the configuration I tried:
And the error message I have when trying to launch the agent:
Reason: Template provisioning failed.
com.github.dockerjava.api.exception.BadRequestException: {"message":"create
/var/run/docker.sock: \"/var/run/docker.sock\" includes invalid characters for a local
volume name, only \"[a-zA-Z0-9][a-zA-Z0-9_.-]\" are allowed. If you intended to pass a
host directory, use absolute path"}
I also tried that configuration:
Reason: Template provisioning failed.
com.github.dockerjava.api.exception.BadRequestException: {"message":"invalid mount config for type \"volume\": invalid mount path: './var/run/docker.sock' mount path must be absolute"}
I do not get what that means as on my linux vm the docker.sock absolute path is /var/run/docker.sock, and it is the same path inside the docker in docker I ran locally...
I tried to check the source code to find what I did wrong but it's unclear what the code is doing for me (https://github.com/jenkinsci/docker-plugin/blob/master/src/main/java/com/nirima/jenkins/plugins/docker/DockerTemplateBase.java, from row 884 onward), I also tried with backslashes, etc. Nothing worked.
Has anyone any idea what is the expected syntax in that configuration panel for setting up a simple volume?
Change the configuration to this:
type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock
it is not a volume, it is a bind type.
This worked for me
type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly

no matching manifest for windows/amd64 10.0.16299 in the manifest list entries error on pulling hello-world image

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

Input file not found in docker command on windows

Complete docker noob here, i installed docker desktop on windows - Trying to follow the commands on this link to setup OSRM backend on my machine. i've downloaded the dataset for india(india-latest.osm.pbf) to D:/docker
and am running the commands from that location
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/india-latest.osm.pbf
fails with
[error] Input file /data/india-latest.osm.pbf not found!
i just don't understand WHY it doesn't work. according to osrm documentation of the docker command -
The file /data/india-latest.osm.pbf inside the container is referring
to "${PWD}/india-latest.osm.pbf" on the host.
but it's not the case,i am running from d:/docker so it should find india-latest.osm.pbf no problem. This is really really confusing to me even though it must be so basic
it was due to a bug in docker https://github.com/docker/for-win/issues/1712
when you change password it silently fails for commands that access the host filesystem on windows until you reauthenticate

Change/Degrade Docker API version

Need some serious help, I have installed docker on ubuntu18.04, and also tested through command 'docker run hello-world', it ran successfully. Now when I run 'docker compose up -d', it says
'Error :Couldn't connect to docker daemon.You may need to create docker-machine start default'.
Also when checked error through docker --verbose it says
'Error:Bad Request : Client API version is too new 1.36 -Maximum supported API version is 1.35'.
that's the case then how can I upgrade the API-version in for docker? My docker version is 17.12.
Plz check if you are running the correct command, it is:
docker-compose up -d
you are missing a "-"

Gitlab-runner + Docker + Windows - Invalid volume specification

I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!
Unfortunately I have no choice but to use windows (I've had success in the past on Linux).
Every time I run a job in powershell:
C:/Gitlab-runner/gitlab-runner exec docker npm
I get an error:
Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)
I've tried setting docker volumes (nemerous combinations) and builds-dir:
C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm
That fails with Error response from daemon: invalid mode: /Gitlab-runner/builds because of the colon after the C..
Can anyone point me in the right direction as I'm stumped?
Using gitlab-runner version 11.5.0
Docker is not fully supported by GitLab Runner on Windows yet.
The workaround is to use Windows Subsystem for Linux and install gitlab-runner there:
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt-get install gitlab-runner
gitlab-runner exec docker build
At the moment there isn't official support for the Docker executor in Windows. A work in progress issue is open at the moment, and it looks like some people have managed to get a windows docker executor working to varying success in that merge request.
This specific comment shows how they've managed to get it setup using a custom built gitlab-runner. I'm unsure how this will work with Services however, so YMMV.

Resources