OpenMediaVault-Plugin-Developers / openmediavault-docker-gui

Docker plugin for OpenMediaVault
32 stars 17 forks source link

Add support for passing additional options to the container #53

Closed Matty666 closed 6 years ago

Matty666 commented 6 years ago

I mistakenly thought that extra args would allow me to provide args that get passed to the container, but every time I tried to add them it failed when saving the modification and attempting to run the container with an error stating that the parameters were not recognised.

It seems that these additional options need to be specified after the image name, and looking at the command that it tries to execute the extra args are passed before the image name, so docker is attempting to use them rather than the container. If I take the command line and move the args to the end it works fine in a command line.

For example this works:

docker run -d --restart=unless-stopped -v /etc/localtime:/etc/localtime:ro --net=bridge -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --name="watchtower" --label omv_docker_extra_args="--interval 3600 --cleanup" "v2tec/watchtower:latest" --interval 3600 --cleanup

And this doesn't:

docker run -d --restart=unless-stopped -v /etc/localtime:/etc/localtime:ro --net=bridge -e PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --name="watchtower" --label omv_docker_extra_args="--interval 3600 --cleanup" --interval 3600 --cleanup "v2tec/watchtower:latest"

subzero79 commented 6 years ago

The extra args are only options passed to the docker run command, not to the container. This is not supported at the moment. Feel free to contribute with a PR for adding this. Please add tooltips or field info texts to stay clear which one args are for the docker run command which ones for the container

Matty666 commented 6 years ago

Sure, I've forked the repo and I'll have a go at it! :) Yeah, need to be clear which args are which, I was thinking to call it container command rather than container args etc. as that seems to be what it's referred to in the docker run docs.

Do you have any tips for setting up a test environment? Don't want to break my install!

subzero79 commented 6 years ago

What about a virtual machine? Virtual box in your desktop is available for all major platforms.

subzero79 commented 6 years ago

Also another thing please commit to master branch, 3.x will not receive any more updates.

Matty666 commented 6 years ago

Yeah, i was poking around in the omv repo and noticed a vagrant file, so I'll use that.

Ok, I'll switch to master. Sorry, I might have got confused, do the version branches match the versions of omv or will master end up being able to be deployed to v3 and v4 of omv?

subzero79 commented 6 years ago

master is atm 4.x, 3.x is that.....

As i already told you your commit or PR won't be accepted as a feature for 3.x, unless is a bugfix. So as a new feature everything goes to master (4.x). If you need this for your personal use, you can build the package yourself.

Matty666 commented 6 years ago

Ok thanks for clarifying

subzero79 commented 6 years ago

Closed by GH-55