When issuing the docker log <container> command, I am getting the following error:
[root#Infra-1 ~]# docker logs gitlab-redis
chmod: changing permissions of '/var/lib/redis': Permission denied
gitlab-redis is a container that has exited.
In fact, the directory does not exist at all:
[root#Infra-1 ~]# ls /var/lib/redis
ls: cannot access /var/lib/redis: No such file or directory
I suppose that docker log is looking in the wrong location. Could it possibly have been misconfigured? Where should I check?
I think docker logs is working, the output of the logs is chmod: changing permissions of '/var/lib/redis': Permission denied.
/var/lib/redis is inside the container, not on the host.
Related
I am running a docker container with a volume mounted (-v) which is a mounted directory on network (NAS). This mount point has write access provisioned to the user which runs docker process on the server.
However when I run the container as docker run -v path1:path2:z I get permission denied error on path1.
Error - docker: Error response from daemon: error while creating mount source path 'path1': mkdir 'path1': Permission Denied
I run a QNAP TS-453a at home running Container Station on it. Suddenly multiple containers got some sort of error about "Permission Denied".
For example postgres\postgres returns:
error: exec failed: permission denied
nodered/node-red docker returns: exec ./entrypoint.sh: permission denied. And this continues in different forms for a total of 20 containers. Basically every container returns permission errors on the docker-entrypoint. I shared my docker.sock with 3 containers to maintain it: HomeAssistant, WatchTower and Portainer.
What I tried:
Recreate the container from scratch
Checked the permissions on the shared volumes
Reinstalled Container Station/Docker
Restart the QNAP NAS
sudo chmod 666 /var/run/docker.sock
Any idea why I can't run docker using Airflow?
The same docker command runs fine from terminal using the user that runs airflow. So there is no permission issue on the Linux side.
But when put it into Airflow dag, it complains
docker: Got permission denied while trying to connect to the Docker
daemon socket at unix:///var/run/docker.sock: Post
http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/create: dial unix
/var/run/docker.sock: connect: permission denied.
The command is simply docker run --rm -v /data:/data:ro docker_image mycommand. It is wrapped inside a python subprocess, so I can't use docker operator.
Note this is not the same issue with the question: How to fix "dial unix /var/run/docker.sock: connect: permission denied" when group permissions seem correct?
There it is a linux permission issue as it cannot run the docker run command. Here the problem is more with Airflow, I think.
Faced a similar issue .
Got it fixed by changing the default_owner(default=airflow) in airflow.cfg to the user having permission to access docker(i.e username belonging to docker group).
Interestingly passing owner in 'default_args' in the DAG definition didn't seem to work
Looks like the reason is in access rights to /var/run/docker.sock.
For dev environment, you can do:
docker exec -ti -u root <container> bash
sudo chmod 777 /var/run/docker.sock
I am trying to setup remote host configuration for docker. After setting up certificates i ran dockerd command which is giving error:
dockerd --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem -H=0.0.0.0:2376
>>> unable to configure the Docker daemon with file /etc/docker/daemon.json: open /etc/docker/daemon.json: permission denied
I am running from non root user and I've already added my user as part of Docker group. Docker version i am using is:
Docker version 17.12.0-ce, build c97c6d6
I have tried below but still getting same error:
1. the /etc/docker/daemon.json file is having {}
2. I also removed the /etc/docker/daemon.json
3. I also changed ownership but same issue.
Permissions of daemon.json were: -rw-r--r--
The dockerd daemon must be run as root. It is creating networking namespaces, mounting filesystems, and other tasks that cannot be done with a user account. You'll need to run these commands with something like sudo.
The docker socket (/var/run/docker.sock) is configured to allow the docker client to access the api by users in the docker group. This is the client, not the daemon, so you can't get away with running the daemon as a user.
I have two questions.
1) I get an error when I run:
karl#karl-laptop:~o docker pull node
2015/04/29 01:39:41 Post http:///var/run/docker.sock/images/create?fromImage=banode&tag=: dial unix /var/run/docker.sock: permission denied
2) When I pull down images, where are they located?
The permission error could be due to the Docker socket being owned by root and thus either you have to use sudo or following the instructions in this link to Create a docker group
For the default docker storage driver, aufs, the images are found in /var/lib/docker/aufs/diff/, assuming the Root Dir for Docker is /var/lib/docker/aufs. You can find this out by running docker info.
Add yourself to the docker group by running
sudo usermod -a -G docker $USER
and log out and back in