Issue with docker container

Hello,
I am using the docker container to mount cvmfs with the following command:
docker run --rm -e CVMFS_CLIENT_PROFILE=single -e CVMFS_REPOSITORIES=cms.cern.ch -e CVMFS_HTTP_PROXY=DIRECT --cap-add SYS_ADMIN --device /dev/fuse --volume $PWD/cvmfs:/cvmfs:shared cvmfs/service

I get the following output:

$ docker run --rm -e CVMFS_CLIENT_PROFILE=single -e CVMFS_REPOSITORIES=cms.cern.ch -e CVMFS_HTTP_PROXY=DIRECT --cap-add SYS_ADMIN --device /dev/fuse --volume cvmfs:/cvmfs:shared  cvmfs/service 
docker: Error response from daemon: invalid volume specification: 'cvmfs:/cvmfs:shared': invalid mount config for type "volume": field BindOptions must not be specified.
See 'docker run --help'.
(base) lenzip@lenzip-XPS-13-9360:~/Documents/CAT/fastAPItest/api$ docker run --rm -e CVMFS_CLIENT_PROFILE=single -e CVMFS_REPOSITORIES=cms.cern.ch -e CVMFS_HTTP_PROXY=DIRECT --cap-add SYS_ADMIN --device /dev/fuse --volume $PWD/cvmfs:/cvmfs:shared  cvmfs/service 
CernVM-FS service container version 2.10.1-1
Tue Aug 22 07:33:54 UTC 2023
===================================================================================

                 ____             __     ____  __       _____ ____                 
                / ___|___ _ __ _ _\ \   / /  \/  |     |  ___/ ___|                
               | |   / _ \ '__| '_ \ \ / /| |\/| |_____| |_  \___ \                
               | |__|  __/ |  | | | \ V / | |  | |_____|  _|  ___) |               
                \____\___|_|  |_| |_|\_/  |_|  |_|     |_|   |____/                

===================================================================================
                                      NOTE                                         
===================================================================================
You should run me on Docker like this
  docker run --cap-add SYS_ADMIN --device /dev/fuse --volume /cvmfs:/cvmfs:shared \
    -e CVMFS_HTTP_PROXY=<site squid> cvmfs/service

Optionally you can also set the 'CVMFS_REPOSITORIES=unpacked.cern.ch,...'
  and 'CVMFS_QUOTA_LIMIT=<cache limit in MB>' environment variables

For even more control, you can bind mount (-v option) a config directory
over the container's default /etc/cvmfs and bind mount a host location
for the cache over /var/lib/cvmfs
===================================================================================
[INF] using CVMFS_HTTP_PROXY='DIRECT'
[INF] using CVMFS_CLIENT_PROFILE='single'
[INF] using CVMFS_QUOTA_LIMIT='4000'
[INF] mounting cvmfs-config.cern.ch cms.cern.ch
CernVM-FS: loading Fuse module... done
CernVM-FS: mounted cvmfs on /cvmfs/cvmfs-config.cern.ch
CernVM-FS: loading Fuse module... done
CernVM-FS: mounted cvmfs on /cvmfs/cms.cern.ch
[INF] done mounting, entering service life cycle

Which looks normal.
However when I list the cvmfs directory, while both cvmfs/cvmfs-config.cern.ch and cvmfs/cms.cern.ch are present, they are both empty.

Can anyone help me debug this issue?
Thanks
Giulio

There’s an error shown when you ran that. You’re missing the leading / in the --volume specification for cvmfs.

Oh, you’re trying to mount it in a relative path, I see. Apparently docker does not allow adding the “:shared” bind option at that point. I’m not sure that the option is actually needed since it’s not doing any automounting. You could try without it.

You might also want to consider using GitHub - cvmfs/cvmfsexec: Mount cvmfs repositories as an unprivileged user. instead of docker.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.