danielguerra69 / ubuntu-xrdp

Docker fully implemented Multi User xrdp with xorgxrdp and pulseaudio on Ubuntu 16.04/18.04
MIT License
251 stars 141 forks source link

/home/ volume #52

Closed mboehm21 closed 3 years ago

mboehm21 commented 3 years ago

Hi,

is there a reason why you define the /home/ directory as a volume in the Dockerfile? I get that this is for persistence but in my opinion this should be handled during deployment (in docker-compose.yml). Then the user could decide if he wants persistence or not. For my use case I want the home directorys to be repopulated when a new container is deployed.

Thanks.

danielguerra69 commented 3 years ago

Your compose file is leading, it is ment for automatic deployment.

mboehm21 commented 3 years ago

When I don’t define a volume in docker-compose.yml, an unnamed volume is created for /home/ because it is defined in the Dockerfile. How can I avoid this?

danielguerra69 commented 3 years ago

Don't use docker-compose and run """docker run -d --name uxrdp --hostname terminalserver --shm-size 1g -p 3389:3389 -p 2222:22 danielguerra/ubuntu-xrdp:20.04"""

mboehm21 commented 3 years ago

Does not really matter whether you provision it with docker or docker-compose:

mboehm21@dws-mboehm21:~$ docker run -d --name uxrdp --hostname terminalserver --shm-size 1g -p 3389:3389 -p 2222:22 danielguerra/ubuntu-xrdp:20.04
52bbe293e2b312bc6c059cb0029fa5821a8bdda098b2e52c47a715ccf5a7fce0
mboehm21@dws-mboehm21:~$ docker volume ls
DRIVER    VOLUME NAME
local     bce341fe21ff83abc7bc41f1620ff1bc944db23fa1cf45605fe5ef9b63f60ea9
local     e0d58b605bee742ff5970ddc2a94132eaa5c4af2bf979a9a9a0d30e3a5097367
mboehm21@dws-mboehm21:~$ docker volume inspect bce341fe21ff83abc7bc41f1620ff1bc944db23fa1cf45605fe5ef9b63f60ea9
[
    {
        "CreatedAt": "2021-06-14T10:37:29+02:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/bce341fe21ff83abc7bc41f1620ff1bc944db23fa1cf45605fe5ef9b63f60ea9/_data",
        "Name": "bce341fe21ff83abc7bc41f1620ff1bc944db23fa1cf45605fe5ef9b63f60ea9",
        "Options": null,
        "Scope": "local"
    }
]
mboehm21@dws-mboehm21:~$ docker volume inspect e0d58b605bee742ff5970ddc2a94132eaa5c4af2bf979a9a9a0d30e3a5097367
[
    {
        "CreatedAt": "2021-06-14T10:37:28+02:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/e0d58b605bee742ff5970ddc2a94132eaa5c4af2bf979a9a9a0d30e3a5097367/_data",
        "Name": "e0d58b605bee742ff5970ddc2a94132eaa5c4af2bf979a9a9a0d30e3a5097367",
        "Options": null,
        "Scope": "local"
    }
]
mboehm21@dws-mboehm21:~$ ls -alh /var/lib/docker/volumes/bce341fe21ff83abc7bc41f1620ff1bc944db23fa1cf45605fe5ef9b63f60ea9/_data
total 556K
drwxr-xr-x 2 root root 4,0K Jun 14 10:37 .
drwx-----x 3 root root 4,0K Jun 14 10:37 ..
-rw-r--r-- 1 root root 523K Jun 14 10:37 moduli
-rw-r--r-- 1 root root 1,6K Jun 14 10:37 ssh_config
-rw-r--r-- 1 root root 3,3K Jun 14 10:37 sshd_config
-rw------- 1 root root 1,4K Jun 14 10:37 ssh_host_dsa_key
-rw-r--r-- 1 root root  609 Jun 14 10:37 ssh_host_dsa_key.pub
-rw------- 1 root root 2,6K Jun 14 10:37 ssh_host_rsa_key
-rw-r--r-- 1 root root  573 Jun 14 10:37 ssh_host_rsa_key.pub
mboehm21@dws-mboehm21:~$ ls -alh /var/lib/docker/volumes/e0d58b605bee742ff5970ddc2a94132eaa5c4af2bf979a9a9a0d30e3a5097367/_data
total 12K
drwxr-xr-x 3 root root 4,0K Jun 14 10:37 .
drwx-----x 3 root root 4,0K Jun 14 10:37 ..
drwxr-xr-x 2  999  999 4,0K Jun 14 10:37 ubuntu

The volumes are created in both ways. The latter volume is the homedir which I want to avoid being created for my setup.

danielguerra69 commented 3 years ago

Sorry, but thats with any container that will write files , like logs ...