Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Host=CentOS7.9.2009, Runs into permissions issue #17

Closed
dharmbhai opened this issue Aug 12, 2022 · 4 comments
Closed

Host=CentOS7.9.2009, Runs into permissions issue #17

dharmbhai opened this issue Aug 12, 2022 · 4 comments
Assignees

Comments

@dharmbhai
Copy link
Contributor

On the Host
[root@cvp01 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@cvp01 ~]#

[root@cvp01 ~]# su - avd
Last login: Fri Aug 12 10:16:00 UTC 2022 on pts/1
[avd@cvp01 ~]$ id
uid=1000(avd) gid=1000(avd) groups=1000(avd)
[avd@cvp01 ~]$

[avd@cvp01 projects]$ sudo docker run --network host --rm -it -v $(pwd):/home/cvp/projects/ avdteam/avd-all-in-one
➜ (AVD 🐳) projects
➜ (AVD 🐳) projects id
uid=1000(avd) gid=1000(avd) groups=1000(avd),27(sudo)
➜ (AVD 🐳) projects ls
➜ (AVD 🐳) projects pwd
/home/avd/projects
➜ (AVD 🐳) projects ls -altr
ls: cannot access '..': Operation not permitted
ls: cannot access '.': Operation not permitted
total 0
d????????? ? ? ? ? ? ..
d????????? ? ? ? ? ? .

➜ (AVD 🐳) projects

AFAIK, UID/GUID are same for Unix avd user on Host as well as Guest.
is this older docker-ce issue ?

[root@cvp01 ~]# rpm -qa | grep docker
cvpi-docker-2022.1.1-2_1657716502.x86_64
docker-ce-18.03.1.ce-1.el7.centos.x86_64
[root@cvp01 ~]#

@dharmbhai
Copy link
Contributor Author

[root@cvp01 ~]# useradd -u 1000 avd
useradd: user 'avd' already exists
[root@cvp01 ~]# cat /etc/passwd | grep avd
avd:x:1000:1000::/home/avd:/bin/bash
[root@cvp01 ~]# mkdir projects
[root@cvp01 ~]# chown -R avd:avd projects/
[root@cvp01 ~]# cd projects/
[root@cvp01 projects]# pwd
/root/projects
[root@cvp01 projects]# docker run --network host --rm -it -v $(pwd):/home/avd/projects/ avdteam/avd-all-in-one
➜ (AVD 🐳) projects id
uid=1000(avd) gid=1000(avd) groups=1000(avd),27(sudo)
➜ (AVD 🐳) projects ls -altr
ls: cannot access '..': Operation not permitted
ls: cannot access '.': Operation not permitted
total 0
d????????? ? ? ? ? ? ..
d????????? ? ? ? ? ? .
➜ (AVD 🐳) projects

@dharmbhai
Copy link
Contributor Author

[root@cvp01 ~]# rpm -qa | grep docker
cvpi-docker-2022.1.1-2_1657716502.x86_64
docker-ce-18.03.1.ce-1.el7.centos.x86_64

The prob is with docker-ce version
Upgrading it to latest most likely fixes the prob

@ankudinov
Copy link
Contributor

Keeping this issue until all-in-one readme is updated. For now please refer to the thread above and the following repository: https://github.com/arista-netdevops-community/avd-quickstart-containerlab
The avd-quickstart repository provides some good examples of changing UID to match the local user.

@ankudinov ankudinov self-assigned this Jan 24, 2023
@ankudinov ankudinov pinned this issue Jan 24, 2023
@ankudinov
Copy link
Contributor

closing as repo is not maintained any more

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants