1

I have deployed multiple containers using a docker-compose.yml file on a raspberry pi. I would like to specify some options for one of those containers. How can I do this ?

To be more specific: I am using the docker image dastrasmue/rpi-samba and I want to set the options -v /data:/share/data and -u "pi:secret" and -s "Pi (private):/share/data:rw:pi" but I have no clue how I can do this in a composite docker application.

JanVdA
  • 338
  • 3
  • 15
  • 1
    https://docs.docker.com/compose/compose-file/#volume-configuration-reference – jonrsharpe Dec 16 '18 at 11:16
  • I think you are mixing docker volumes and samba shares that are set with the above `-v` option. Those are not the same things. – JanVdA Dec 16 '18 at 11:26
  • I have updated questions with some other options I would like to set. – JanVdA Dec 16 '18 at 11:31
  • 1
    `-v` on `run` sets volumes. The `volumes` section of the compose file sets the same thing. – jonrsharpe Dec 16 '18 at 11:31
  • thanks for the answer, but how can I set the other options `-u` and `-s` ? – JanVdA Dec 16 '18 at 11:38
  • Please read the related docs; look up what those options are doing, then search for the same thing in the compose file reference. – jonrsharpe Dec 16 '18 at 11:39
  • Options `-u` and `-s` are handled by the script `run.sh` (https://github.com/dastrasmue/rpi-samba/blob/master/run.sh) of the docker container. You are right about the `-v` option but options `-u` and `-s` are specific options for that container. I also didn't find a corresponding thing in the compose file reference for those 2 options. – JanVdA Dec 16 '18 at 11:50
  • There's a sample `docker run` invocation at line 57 of that script; the options after the image name are command-line arguments to the script itself. – David Maze Dec 16 '18 at 12:00
  • Yes, that is clear in case you run a single container application, but how do you do that when using a multi container application that is specified through a docker-compose.yml file. – JanVdA Dec 16 '18 at 12:02
  • Thanks, adding the line `command: -s "Public (readonly):/mount:ro:"` to the docker compose yml file did indeed created a public samba share. – JanVdA Dec 16 '18 at 13:14

0 Answers0