I'm trying to install the https://github.com/dani-garcia/bitwarden_rs docker container on OSX (docker installed via a brew cask).
Running:
docker pull bitwardenrs/server:latest
successfully pulls the image but running
docker run -d --name bitwarden -v /bw-data/:/data/ -p 80:80 /bitwardenrs/server:latest
results in
docker: Error response from daemon: Mounts denied: no context set
I could not find any mention of that docker error anywhere
Thank you! It was indeed a directory permission issue, pointing it at any shared directory fixes it, e.g.
docker run -d --name bitwarden -v /tmp/bw-data/:/data/ -p 80:80 bitwardenrs/server
Related
I'm running Docker on my Synology DS918+ and I'm looking to run the jetbrains/teamcity-server container.
When I run the following command:
sudo docker run teamcity-server -v /volume2/docker/teamcity-server/datadir/:/data/teamcity_server/datadir -v /volume2/docker/teamcity-server/logs/:/opt/teamcity/logs -p 8001:8001 jetbrains/teamcity-server:latest
I get a result back that it can't find the image locally:
Unable to find image 'teamcity-server:latest' locally
docker: Error response from daemon: pull access denied for teamcity-server, repository does not exist or may require 'docker login'.
See 'docker run --help'.
I believe that I have confirmed that I have the image installed locally because when I run the command:
sudo docker images
I get the following result:
REPOSITORY TAG IMAGE ID CREATED SIZE
jetbrains/teamcity-server latest bfe4a2f841c1 2 weeks ago 2.2GB
The correct way is to use --name before the container name (teamcity-server). Otherwise, docker will think that it is the image that you are trying to pull and error out.
sudo docker run --name teamcity-server -v /volume2/docker/teamcity-server/datadir/:/data/teamcity_server/datadir -v /volume2/docker/teamcity-server/logs/:/opt/teamcity/logs -p 8001:8001 jetbrains/teamcity-server:latest
Trying to run masquitto Docker container on Windows. I have directory structure:
..
mosquitto
config
-- mosquitto.conf
data
log
I run command:
docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto
Got error:
docker: Error response from daemon: source /var/lib/docker/overlay2/c54f317f73085489398e1b2c4ffbc85fbdb18073e8a0fa60f11a7f7222fbc49d/merged/mosquitto/config/mosquitto.conf is not directory.
See 'docker run --help'.
What I do wrong?
UPD
I tried to provide full path to config file on host machine:
docker run -it -p 1883:1883 -p 9001:9001 -v C:/docker_tst/eclipse-mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto
Got error:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/run/desktop/mnt/host/c/docker_tst/eclipse-mosquitto/mosquitto.conf" to rootfs at "/var/lib/docker/overlay2/d9a7cbcb0f85b195dc5ee2d0999b3df8c84324552f6c45cf218876e9b96ed826/merged/mosquitto/config/mosquitto.conf" caused: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
PS C:\docker_tst\eclipse-mosquitto>
From the comments, the solution was to provide an absolute path to the single mounted file, per this answer.
On Unix based systems or in Windows Subsystem for Linux, you can do this by running something like:
docker run -v $PWD/filename:/path/in/container IMAGE_NAME
However, the process is different on Windows, per this answer.
In PowerShell, you can run Get-Location or pwd to get the current directory where your file is and switch the \ to / (forward slashes). For this example, the solution was to use this command:
docker run -it -p 1883:1883 -p 9001:9001 -v C:/docker_tst/eclipse-mosquitto/mosquito/config/mosquito.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto
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
Docker volume mount fails with the below error.
I'm trying to run a container with a config file in the volume and it fails with the below errors.
root#ip-172-31-21-249:~/data# docker run -it -p 8080:8080 -p 29418:29418 -v /root/data:/var/gerrit/etc/ forkub
error: could not lock config file /var/gerrit/etc/gerrit.config: Permission denied
root#ip-172-31-21-249:~/data# docker run -it -p 8080:8080 -p 29418:29418 -v /root/data:/var/gerrit/etc forkub
error: could not lock config file /var/gerrit/etc/gerrit.config: Permission denied
root#ip-172-31-21-249:~/data# docker run -it -p 8080:8080 -p 29418:29418 -v /root/data/:/var/gerrit/etc forkub
error: could not lock config file /var/gerrit/etc/gerrit.config: Permission denied
root#ip-172-31-21-249:~/data# docker run -it -p 8080:8080 -p 29418:29418 -v /root/data/:/var/gerrit/etc/ forkub
error: could not lock config file /var/gerrit/etc/gerrit.config: Permission denied
root#ip-172-31-21-249:~/data# docker run -it -p 8080:8080 -p 29418:29418 -v /root/data/:/var/gerrit/etc/gerrit.config forkub
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/root/data\\\" to rootfs \\\"/var/lib/docker/overlay2/0a5356aed5a1aa1d1359912ccba7547db55b0377b3a509b898828734868e335a/merged\\\" at \\\"/var/lib/docker/overlay2/0a5356aed5a1aa1d1359912ccba7547db55b0377b3a509b898828734868e335a/merged/var/gerrit/etc/gerrit.config\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
ERRO[0000] error waiting for container: context canceled
Any suggestions on fixing this is really appreciated.
Thank you,
Anish
Probably the process in the container does not run as root but as some other user. The file belongs to root though and is not readable by the user that runs the process. So the process can not read the file.
So you need to make sure that the user that runs the process in the container can access those files. The easiest way would be to make /root/data world read-/writeable (chmod -R 777 /root/data) but this is obviously not the best way. The right way to do this, would be to find out which user is running the process in the container and change the ownership of /root/data and everything in it to that user.
The problem with docker run -it -p 8080:8080 -p 29418:29418 -v /root/data/:/var/gerrit/etc/gerrit.config forkub is, that you are trying to mount a directory /root/data to a file. This does not work.
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.