[IDEA] - Share dockers in xml format


Recommended Posts

I'm working on a code that will allow users to create containers directly from xml templates.

 

Right now it only save/retrieve info that is inserted by the user, but the idea is to embed templates for the most used containers maintained by the community.

 

What do you this about this:

 

<?xml version="1.0" encoding="utf-8"?>
<Container>
  <Name>Couchpotato</Name>
  <Description>
    CouchPotato (CP) is an automatic NZB and torrent downloader. You can keep a "movies I want"-list and it will search for NZBs/torrents of these movies every X hours. Once a movie is found, it will send it to SABnzbd or download the torrent to a specified directory.[br][br]
    [b][span style='color: #E80000;']Directions:[/span][/b][br]
    [b]/config[/b] : this path is used to store the configuration and the database files of Couchpotato.[br]
    [b]/downloads[/b] : this path is used retrieve the downloaded files by your downloader application (e.g. SABnzbd or NZBGet)[br]
    [b]/movies[/b] : set this path to where you wish Couchpotato move your movies to.
  </Description>
  <Registry>https://registry.hub.docker.com/u/needo/couchpotato/</Registry>
  <Repository>needo/couchpotato</Repository>
  <BindTime>true</BindTime>
  <Privileged>false</Privileged>
  <Networking>
    <Mode>bridge</Mode>
    <Publish>
      <Port>
        <HostPort>5050</HostPort>
        <ContainerPort>5050</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
    </Publish>
  </Networking>
  <Environment>
    <Variable>
      <Name>EDGE</Name>
      <Value>1</Value>
    </Variable>
  </Environment>
  <Data>
    <Volume>
      <HostDir></HostDir>
      <ContainerDir>/config</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
    <Volume>
      <HostDir></HostDir>
      <ContainerDir>/downloads</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
    <Volume>
      <HostDir></HostDir>
      <ContainerDir>/movies</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
  </Data>
</Container>

 

This is the final result of my code.

 

Any ideas or suggestions?

Link to comment
  • Replies 70
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Yeah, I installed it, and it's awesome!  (I also suggested a couple of 'improvements' in that thread).

 

I also see the big PLUS sign that lets you fill in a bunch of information to create a container.  I wonder if it would be easier to just bring up a box that lets you paste the run command, and you just run that in the background.

 

I still don't see the benefit of the xml option (not to say it's not a good idea, just that it doesn't make obvious sense to me)

Link to comment

Yeah, I installed it, and it's awesome!  (I also suggested a couple of 'improvements' in that thread).

 

I also see the big PLUS sign that lets you fill in a bunch of information to create a container.  I wonder if it would be easier to just bring up a box that lets you paste the run command, and you just run that in the background.

 

I still don't see the benefit of the xml option (not to say it's not a good idea, just that it doesn't make obvious sense to me)

 

Update the plugin and test the template usage. It will store the configuration of every new container you create and will let you reuse that configuration.

 

That's what this thread about.

Link to comment

Very nice.  I thought you were suggesting a user fill out the xml instead of just running the run command, which didn't sound easier.  now that I've updated the plugin, and went to add a container, I see what you've done.  Nice.

 

I got this...

 

Command: /usr/bin/docker run -d --name="SABnzbd" --net="bridge" -p 9992:8080/tcp -p 9999:9090/tcp -v "/mnt/user":"/mnt/user":rw -v "/etc/localtime":"/etc/localtime":ro needo/sabnzbd

2014/07/03 14:09:22 Error: Cannot start container 7c86a5b9dd99d6e29eda4ce09b0be89e7f76997aa33a79cd5063d6b98eef0af6: port has already been allocated 

 

Of course, that makes sense.

 

It looks like it took my input (which I sort of guessed at), and put it into the run command, and it looks like it did it 'perfectly'.

 

I'm not sure if the run command needs the " around all the options I entered, but it sure doesn't seem to hurt anything; at least my fail message didn't seem to be related to that.

 

I would suggest that perhaps you add a bit of description to the box where we enter values, since new folks will probably not know what you're looking for in those boxes.

 

Also, perhaps you could pull against a 'known' database of repositories, and pre-fill the container information for users.  i.e. from needo/sabnzb, you could put 8080 and 9090 in the container port boxes, since his container needs those values.  i don't know what would happen if a user entered different values there, but i suspect it wouldn't work right.

 

Finally, I didn't know what, if anything should be put in the environmental variables section, so I left it blank.  it seems this was fine, but going back to helping a new user, an explanation or description might be helpful there also.

 

With all that said, none of that is a complaint in any way; I think it's awesome what you've done here.  I just wanted to provide some feedback.

 

Finally, I think you're the first/only person to use the new plugin 'system' and it seems to work great.  I installed it from the "install extension" box, and it shows your plugin on the list, and works seamlessly.  I was also able to update the plugin with this system with no effort; genius!  Hopefully others learn how to copy this aspect from your plugin design.

 

Thanks for doing this.

Link to comment

I just tried starting the container I created, and I think I might have needed to add the /config location somewhere in the create box, since it's not starting, and complaining about the config.

 

So, I clicked the add container icon, and it shows my-SABnzbd in the template box, but when I select it, the boxes are blank.  I assumed it would have kept the information I had entered, so that I could duplicate what I'd done before (and could verify if I just missed entering a value somewhere).  Perhaps this is a bug, but if not, consider it an enhancement request.

 

I suspect you mean for it to populate data in the boxes, otherwise why offer 'templates'; but since they are all blank, I suspect a bug somewhere.

Link to comment

Sorry, one more thing.  When I go to remove a container, if it's running, it tells me I have to stop the container first.  Perhaps you could either just stop it, then remove it, without the warning, or offer a button to 'stop now and remove' from the warning box, to save a few clicks.

 

Also, maybe you could offer to 'permanently' remove the container in this process also.  I know you can do so in the section below, but if I know I want to grab an updated version (like the nzbdrone needo just updated and released), clicking one 'fully update' button (or similar) would be nice.

 

Not a big deal, just thinking out loud.

Link to comment

I added Host Path of /mnt/cache/appdata/sabnzbd and container volume of /config, but that didn't seem to make it into the run command.

 

So, I'm not sure where the config is getting placed, but I'm unable to start the container.

 

I'll reinstall it from command line, but it looks like you're really close!!

Link to comment

I added Host Path of /mnt/cache/appdata/sabnzbd and container volume of /config, but that didn't seem to make it into the run command.

 

So, I'm not sure where the config is getting placed, but I'm unable to start the container.

 

I'll reinstall it from command line, but it looks like you're really close!!

One of your ports is already binded by a container, or Docker has failed to release it. Remove the other container and restart Docker.

Link to comment

Sorry, one more thing.  When I go to remove a container, if it's running, it tells me I have to stop the container first.  Perhaps you could either just stop it, then remove it, without the warning, or offer a button to 'stop now and remove' from the warning box, to save a few clicks.

 

Also, maybe you could offer to 'permanently' remove the container in this process also.  I know you can do so in the section below, but if I know I want to grab an updated version (like the nzbdrone needo just updated and released), clicking one 'fully update' button (or similar) would be nice.

 

Not a big deal, just thinking out loud.

 

The "-f" statement will do just that, but I'm unsure if it's the case. It's a very small change in the code, I just not feel it's the way it should be done.

Link to comment

I just tried starting the container I created, and I think I might have needed to add the /config location somewhere in the create box, since it's not starting, and complaining about the config.

 

So, I clicked the add container icon, and it shows my-SABnzbd in the template box, but when I select it, the boxes are blank.  I assumed it would have kept the information I had entered, so that I could duplicate what I'd done before (and could verify if I just missed entering a value somewhere).  Perhaps this is a bug, but if not, consider it an enhancement request.

 

I suspect you mean for it to populate data in the boxes, otherwise why offer 'templates'; but since they are all blank, I suspect a bug somewhere.

 

Please take a look at the file /boot/config/plugins/Docker/my-SABnzbd.xml and post it here.

Link to comment

I just tried starting the container I created, and I think I might have needed to add the /config location somewhere in the create box, since it's not starting, and complaining about the config.

 

So, I clicked the add container icon, and it shows my-SABnzbd in the template box, but when I select it, the boxes are blank.  I assumed it would have kept the information I had entered, so that I could duplicate what I'd done before (and could verify if I just missed entering a value somewhere).  Perhaps this is a bug, but if not, consider it an enhancement request.

 

I suspect you mean for it to populate data in the boxes, otherwise why offer 'templates'; but since they are all blank, I suspect a bug somewhere.

 

Please take a look at the file /boot/config/plugins/Docker/my-SABnzbd.xml and post it here.

 

It seems it didn't save the config volume, perphaps I didn't click "add" on that one (although I thought I did).

 

<?xml version="1.0" encoding="utf-8"?>
<Container>
  <Name>SABnzbd</Name>
  <Repository>needo/sabnzbd</Repository>
  <BindTime>true</BindTime>
  <Privileged>false</Privileged>
  <Networking>
    <Mode>bridge</Mode>
    <Publish>
      <Port>
        <HostPort>9992</HostPort>
        <ContainerPort>8080</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
      <Port>
        <HostPort>9999</HostPort>
        <ContainerPort>9090</ContainerPort>
        <Protocol>tcp</Protocol>
      </Port>
    </Publish>
  </Networking>
  <Environment/>
  <Data>
    <Volume>
      <HostDir>/mnt/user/</HostDir>
      <ContainerDir>/mnt/user</ContainerDir>
      <Mode>rw</Mode>
    </Volume>
  </Data>
</Container>

 

As for forcing the removal of the container, I understand your reluctance to force that on a running container.  I was thinking that perhaps a button could be placed inside the 'you can't stop a running container' warning message, that says 'stop now and remove', so you wouldn't have to close, stop, then re-remove the container.

 

Not a big deal either way, just a suggestion :)

Link to comment

I just went back to the add containers section, and this time my-sabnzbd had my information in there.  i added the /config info to the volume section, then made sure to add it, then hit Add, and this time it worked.  I had to change to a different port, but once I did that, I was able to see my SAB on both ports.

 

Nice work!

Link to comment

I just went back to the add containers section, and this time my-sabnzbd had my information in there.  i added the /config info to the volume section, then made sure to add it, then hit Add, and this time it worked.  I had to change to a different port, but once I did that, I was able to see my SAB on both ports.

 

Nice work!

[/quote

 

I shipped 4 or 5 templates with this release, are showing up??

Link to comment

I just went back to the add containers section, and this time my-sabnzbd had my information in there.  i added the /config info to the volume section, then made sure to add it, then hit Add, and this time it worked.  I had to change to a different port, but once I did that, I was able to see my SAB on both ports.

 

Nice work!

 

I shipped 4 or 5 templates with this release, are showing up??

 

Not the first time I opened the tool, but now that I've created one, I see info in all the others.  Not sure if something needs to happen for them to generate, or what.  I tried selecting (only) the sabnzbd template the first time I used it, and it was completely blank.

Link to comment

Thanks gfjardim for your hard work!  I just installed your updated plugin and it looks good.  I was wondering if you could explain what each section does with examples?  I am still trying to wrap my head around the path parts.

 

Try picking one of the templates.  Does that pre-populate some of the fields for you?  if so, that should be a good guide to what you need to enter (fill in any blank boxes to the left of populated ones).

 

If not, you got the same thing I got the first time I tried it, and you'll have to fill out everything from scratch (bug?)

Link to comment

Thanks gfjardim for your hard work!  I just installed your updated plugin and it looks good.  I was wondering if you could explain what each section does with examples?  I am still trying to wrap my head around the path parts.

 

Try picking one of the templates.  Does that pre-populate some of the fields for you?  if so, that should be a good guide to what you need to enter (fill in any blank boxes to the left of populated ones).

 

If not, you got the same thing I got the first time I tried it, and you'll have to fill out everything from scratch (bug?)

 

This is what I got when I picked Sabnzbd below.

 

docker.JPG.7c7df33b9c32d0e9aa6898af568817f0.JPG

Link to comment

That's it! Where you see /config:rw you put your path to store the program settings in the Host path column.

 

See my example bellow.

 

What about any variables?  What happens after you press the add button?

 

So this is just for building templates.  It does not pull the container?

 

Ok I see it keep my settings when I went back to it called mysabnzbd.

 

 

Link to comment

What happens after you press the add button?

 

So this is just for building templates.  It does not pull the container?

 

It should pull and install the container, based on those settings.  it will show a dialog box that shows the run command it used, which will be populated with the selections you made in that template.

Link to comment

What happens after you press the add button?

 

So this is just for building templates.  It does not pull the container?

 

It should pull and install the container, based on those settings.  it will show a dialog box that shows the run command it used, which will be populated with the selections you made in that template.

 

Ok I clicked add and it just stayed on the screen.  I also noticed when you type in your ports you have to click add port to get it to keep your port setting.

 

*** Update ***  Looks like it pulled it down and created the container. I just didn't wait long enough I have slow DSL!

Link to comment

What happens after you press the add button?

 

So this is just for building templates.  It does not pull the container?

 

It should pull and install the container, based on those settings.  it will show a dialog box that shows the run command it used, which will be populated with the selections you made in that template.

 

Ok I clicked add and it just stayed on the screen.  I also noticed when you type in your ports you have to click add port to get it to keep your port setting.

 

*** Update ***  Looks like it pulled it down and created the container. I just didn't wait long enough I have slow DSL!

 

I don't think it setting the permissions right on the folder level. When I started sabnzbd it shows up with empty directory. I look at the file permissions and its set to Root.  I thought it was supposed to be set to nobody?

 

Thanks

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.