-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
approach to binding a directory (from host machine) to containers $HOME
directory
#40
Comments
Hello @capsulecorplab , I'm preparing the answer and testing the many variations of your scenario, but it's growing and the answer is becoming to be too complex. We have to constrain it a little bit. Can you please answer the following questions? A) Is your scenario primarily about
B) On what environment are you
Also be aware, that your Regards, |
kind of both? The behavior I'd like to see is akin to how kasm workspaces binds a
Linux (specifically, Linux Mint 21.1) running docker (version 20.10.12), no Docker Desktop for Linux
I'd be curious as to what you mean, since the yaml example currently works for producing the aforementioned behavior - it just requires the previously mentioned steps of manual copying files/folders into that persistent directory from a previous vnc session |
I see, you compare it to Kasm Workspaces. :) I'll check what they provide, because I'm not familiar with them yet. |
I've promised that I'll comment the I'll comment out the lines that I would not use. version: "3.7"
services:
ubuntu-vnc-xfce-g3:
### generally, no need to use 'build' if you don't want to extend the base image
### in this case the default file named 'Dockerfile' from the current directory would be used by 'compose'
### however, I cannot say anything about it, because I don't know its content
### generally speaking, it should extent the base image **correctly**, otherwise it will not work
# build: .
### if you don't want to extend the base image, then just use it
### be sure to remove this 'image' tag if you decide to use 'build'
### otherwise 'compose' will try to push the image into the default repository
image: accetto/ubuntu-vnc-xfce-g3:latest
ports:
### I recommend to avoid the ports 5901/6901 on the host
# - "5901:5901"
### I would use some higher ports and I would bind also the noVNC port
- "25901:5901
- "26901:6901
### I recommend to avoiad the root user if it's not a requirement
### e.g. some applications will refuse to run as a root
# user: "0"
### you can override the defualt container user (1000) if you wish
# user: 1002
environment:
VNC_PW: password
### just a tip: for testing you could use also an empty password
# VNC_PW: ""
### just a remark: '256m' seems to be usually enough
shm_size: '512m'
### I'm not sure of the purpose of these two lines, I never used it this way
### actually the image provides Xfce Desktop, so you should not need them
### you can use the terminal inside the container
# stdin_open: true # docker run -i
# tty: true # docker run -t
volumes:
### this way of binding to an external volume on the host
### will not work correctly on any environment
### I'll provide more detailed explantion later, but
### you should not bind the whole $HOME directory
# - type: bind
# source: ./shared
# target: /home/headless
### prefer binding the individual subfolders, for example
- type: bind
source: ./shared/Documents
target: /home/headless/Documents
### the only working option is to use Docker volumes
### note that this will work starting from my release 23.03.2
# - type: volume
# source: my-home-volume
# target: /home/headles
### note that you'll need to add the following above the 'services' level
# volumes:
# my-home-volume
### I'm not sure of the purpose of these two lines
### I also haven't found this exact value in the official documentation
# security_opt:
# - seccomp=unconfined I'll continue in the discussion thread #39 you've opened and I'll put my recommended |
Closing this issue because it has been continued in the discussion thread #39. |
I have a use case where I'd like to configure and persist dotfiles/folders in the
$HOME
directory of a container running theubuntu-vnc-xfce-g3
image. My current working approach has been to bind a directory from my host machine that contains the expected dotfiles/folders (s.a.,.vnc/
) to the container's$HOME
directory via the followingdocker-compose.yml
file anddocker-compose up
command, where./shared
is the persistent folder containing the expected dotfiles/folders,In the above example, the dotfiles were originally obtained by first binding
./shared
(source volume) to a directory nested in/home/headless
, s.a.,/home/headless/shared
(target volume) then copying over the contents of/home/headless/
into/home/headless/shared
from within a vnc session, then changing target volume from/home/headless/shared
to/home/headless
. Would it be possible for the image to be pre-configured to copy these dotfiles into this persistent directory upon initial creation of the container?The text was updated successfully, but these errors were encountered: