Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

root and docker setup don't appear to play nice #86

Open
jdandrea opened this issue Apr 24, 2018 · 1 comment
Open

root and docker setup don't appear to play nice #86

jdandrea opened this issue Apr 24, 2018 · 1 comment

Comments

@jdandrea
Copy link

Consider refusing to run ccloudvm as root?

Here's a grep of docker from cloud-init-output.log on the VM when setting up a singlevm instance for ciao.

root@singlevm:/var/log# grep docker cloud-init-output.log 
Get:4 https://download.docker.com/linux/ubuntu xenial InRelease [65.8 kB]
Get:5 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [3,539 B]
  aufs-tools cgroupfs-mount docker-ce libltdl7 pigz
Get:5 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 18.03.0~ce-0~ubuntu [33.9 MB]
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_18.03.0~ce-0~ubuntu_amd64.deb ...
Unpacking docker-ce (18.03.0~ce-0~ubuntu) ...
Setting up docker-ce (18.03.0~ce-0~ubuntu) ...
Adding user root to group docker
mkdir: cannot create directory '/home/root/.docker': No such file or directory
/var/lib/cloud/instance/scripts/runcmd: 30: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 31: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 32: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 33: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 34: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 35: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 36: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 37: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 38: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 39: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
/var/lib/cloud/instance/scripts/runcmd: 40: /var/lib/cloud/instance/scripts/runcmd: cannot create /home/root/.docker/config.json: Directory nonexistent
chown: cannot access '/home/root/.docker': No such file or directory
Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease

Notice /home/root does not appear to exist when it's first needed, but later on it does:

root@singlevm:/# cd /home/root
root@singlevm:/home/root# ls -al
total 16
drwxr-xr-x 3 root root 4096 Apr 24 15:06 .
drwxr-xr-x 4 root root 4096 Apr 24 15:05 ..
drwxr-xr-x 2 root root 4096 Apr 24 15:06 local
-rw-r--r-- 1 root root  137 Apr 24 15:06 .profile
root@singlevm:/home/root# cd
root@singlevm:~# ls -al
total 56
drwx------  7 root root 4096 Apr 24 17:17 .
drwxr-xr-x 23 root root 4096 Apr 24 14:32 ..
-rw-------  1 root root  516 Apr 24 15:17 .bash_history
-rw-r--r--  1 root root 3106 Oct 22  2015 .bashrc
drwx------  2 root root 4096 Apr 24 15:09 .cache
drwxr-xr-x  2 root root 4096 Apr 24 15:30 local
-rw-r--r--  1 root root  148 Aug 17  2015 .profile
-rw-------  1 root root 1024 Apr 24 15:19 .rnd
-rw-r--r--  1 root root  626 Apr 24 15:59 set-env
drwx------  2 root root 4096 Apr 24 15:09 .ssh
-rw-------  1 root root 6148 Apr 24 17:17 .viminfo
@markdryan
Copy link
Contributor

This is an issue with all the xenial derived workloads which assume that the home directory is /home/{{.User}}, which does not seem to be the case for root. We might be able to fix this by using the homedir directive. I'll check.

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