Docker help


jcreynoldsii

Recommended Posts

I can see that the container does properly copy the files from github.  However those files are not being hosted on unraid when I link to the /config volume.

 

Link to project:  https://github.com/jcreynolds/hadashboard

Link to unraid xml: https://github.com/jcreynolds/docker-templates/blob/master/HADashboard.xml

Link to docker hub:  https://hub.docker.com/r/jcreynolds/hadashboard/

 

What am I missing?

 

Link to comment
  • 2 weeks later...

Has there been any progress on this container?  I have been unable to get it started and receive the following in the docker log.  I appreciate any help.

 

Traceback (most recent call last):
File "/usr/src/app/hapush/hapush.py", line 347, in <module>
main()
File "/usr/src/app/hapush/hapush.py", line 298, in main
config = ConfigObj(config_file, file_error=True)
File "/usr/local/lib/python3.4/dist-packages/configobj.py", line 1229, in __init__
self._load(infile, configspec)
File "/usr/local/lib/python3.4/dist-packages/configobj.py", line 1240, in _load
raise IOError('Config file not found: "%s".' % self.filename)
OSError: Config file not found: "/hapush/hapush.cfg".

Link to comment

docker run --name="hadashboard" -d /
-v <path_to_hadashboard>/dashboards:/app/dashboards /
-v <path_to_hadashboard>/lib/ha_conf.rb:/app/lib/ha_conf.rb /
-v <path_to_hadashboard>/hapush:/app/hapush /
--net=host hadashboard

 

Doesn't look like the xml includes paths to any of this stuff....

 

But I haven't looked at this beyond reading the readme...

 

Looks like you need the folder for hadashboard in your /config file or something....

 

Also have you guys done this bit?

 

Might be worth someone actually putting down what steps they've tried so far.

 

Link to comment

I gave it four solid days with absolutely no luck, I had 0 luck getting the volumes to share data between the host and container.  I have scoured the docker forums and home-assistant forums for help and no one has stepped forward to give me any assistance.  I really want this on my unRaid instead of a RPi as well.  I suppose I'll have to give this another go, I just got burnt out the first time.

Link to comment

docker run --name="hadashboard" -d /
-v <path_to_hadashboard>/dashboards:/app/dashboards /
-v <path_to_hadashboard>/lib/ha_conf.rb:/app/lib/ha_conf.rb /
-v <path_to_hadashboard>/hapush:/app/hapush /
--net=host hadashboard

 

Doesn't look like the xml includes paths to any of this stuff....

 

But I haven't looked at this beyond reading the readme...

 

Looks like you need the folder for hadashboard in your /config file or something....

 

Also have you guys done this bit?

 

Might be worth someone actually putting down what steps they've tried so far.

 

the xml did contain those paths, however after many iterations of modifying the Dockerfile and xml to try to get this run it was left in a state of only one mapped volume.  I have re-modified the XML and Dockerfile to reflect these changes to include the volumes for this path.  Waiting on docker hub to build as we speak.  I'll report back after that.

 

hapush is or should rather, be installed via the docker setup.  I have gotten this whole project up and running the other way.  But would really like to get this to work via a docker container.

 

Ultimately I would like this docker to go out and get the files from the github repo.  But haven't worried about this until I get the other method working.

Link to comment

Just had a quick look at the docker file. Is there anything installed in the volumes you specify? I see you have some install commands after creating the volumes.

If you do install something there, and you map the volume on container start, those folders will be empty. A volume mapping overwrites the earlier layer even though there is no files in the host folder.

Link to comment

Just had a quick look at the docker file. Is there anything installed in the volumes you specify? I see you have some install commands after creating the volumes.

If you do install something there, and you map the volume on container start, those folders will be empty. A volume mapping overwrites the earlier layer even though there is no files in the host folder.

 

So should I setup my VOLUMES after the install like so:

 

FROM ruby:2.2.5
MAINTAINER jcreynolds

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN apt-get update \
&& apt-get install -y \
      sqlite \
      nodejs \
      libpq-dev \
      libssl-dev \
      libsqlite3-dev \
      ruby-dev \
      python3 \
      python3-pip \
&& rm -rf /var/lib/apt/lists/*

COPY . .

EXPOSE 3030

RUN gem install dashing \
&& gem install bundler \
&& bundle \
&& pip3 install daemonize sseclient configobj \
&& pip3 install --upgrade requests

VOLUME /usr/src/app/lib /usr/src/app/dashboards /usr/src/app/hapush

CMD /usr/src/app/hapush/hapush.py -d /hapush/hapush.cfg && dashing start

 

Also what would be the best means for having the Dockerfile copy the files from the original projects github to the host?  Ultimately I would like to bypass the repo cloning steps: https://github.com/home-assistant/hadashboard#using-docker-non-raspian

 

Is there a better base image to use rather than Ruby 2.2.5

 

Perhaps I am getting closer appears to have a permissions issue is there any thing suspect in the Dockerfile to you saarg?

 

/bin/sh: 1: /usr/src/app/hapush/hapush.py: Permission denied

Link to comment

I don't think there's a base image problem, it uses a ruby base image as it needs ruby.....

 

Fair enough.  Is there anything suspicious in regards to permission issues?

 

Might be worth someone actually putting down what steps they've tried so far.

 

To be honest I don't really have a clue what you've done and what you're doing, no offence, but I think if you actually documented exactly what you've done thus far, it would be very useful for people to try and help you.  Being brutally honest this whole docker confuses me....

Link to comment

Just had a quick look at the docker file. Is there anything installed in the volumes you specify? I see you have some install commands after creating the volumes.

If you do install something there, and you map the volume on container start, those folders will be empty. A volume mapping overwrites the earlier layer even though there is no files in the host folder.

 

So should I setup my VOLUMES after the install like so:

 

FROM ruby:2.2.5
MAINTAINER jcreynolds

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN apt-get update \
&& apt-get install -y \
      sqlite \
      nodejs \
      libpq-dev \
      libssl-dev \
      libsqlite3-dev \
      ruby-dev \
      python3 \
      python3-pip \
&& rm -rf /var/lib/apt/lists/*

COPY . .

EXPOSE 3030

RUN gem install dashing \
&& gem install bundler \
&& bundle \
&& pip3 install daemonize sseclient configobj \
&& pip3 install --upgrade requests

VOLUME /usr/src/app/lib /usr/src/app/dashboards /usr/src/app/hapush

CMD /usr/src/app/hapush/hapush.py -d /hapush/hapush.cfg && dashing start

 

Also what would be the best means for having the Dockerfile copy the files from the original projects github to the host?  Ultimately I would like to bypass the repo cloning steps: https://github.com/home-assistant/hadashboard#using-docker-non-raspian

 

Is there a better base image to use rather than Ruby 2.2.5

 

Perhaps I am getting closer appears to have a permissions issue is there any thing suspect in the Dockerfile to you saarg?

 

/bin/sh: 1: /usr/src/app/hapush/hapush.py: Permission denied

You can read more about the volume mounts and existing folders in the container here

 

We always clone the got repository when building the containers. That way it's clear for all where we pull it from and we don't need to maintain a fork ourselves. The way you have done it, to fork the source and then make the docker part inside the fork, just makes a mess. Much easier to maintain only the docker stuff.

Take a look at our containers to see how it can be done.

 

As for the permission problems, I don't really have the time, energy or state of mind to look at it now.

Link to comment

saarg and CHBMB thanks for your honesty.  CHBMB, let me get things configured in a manner where the file gets pulled into the volumes from the master branch for this project, per the link saarg provided.  From there I will document the steps I have taken to write a successful Dockerfile and got from there.  Dockers are great, but if you don't understand the in's and out's of them they are a royal pain.  Ultimately, that is my road block.  I know what I want to do, I don't always know how to do it and sometimes I have a hard time explaining it to others.  However, since there are a couple of others that have also spoken up about wanting this to work for them as well I will press on and continue updating this thread with my findings and hopefully in the very near future, solution.

 

CHBMB, I will tell you that I tried using the Dockerfile as is and installation instructions in the master branch and had absolutely 0 luck.

 

Master Branch: https://github.com/home-assistant/hadashboard

Install instructions: https://github.com/home-assistant/hadashboard#using-docker-non-raspian

Link to comment

saarg and CHBMB thanks for your honesty.  CHBMB, let me get things configured in a manner where the file gets pulled into the volumes from the master branch for this project, per the link saarg provided.  From there I will document the steps I have taken to write a successful Dockerfile and got from there.  Dockers are great, but if you don't understand the in's and out's of them they are a royal pain.  Ultimately, that is my road block.  I know what I want to do, I don't always know how to do it and sometimes I have a hard time explaining it to others.  However, since there are a couple of others that have also spoken up about wanting this to work for them as well I will press on and continue updating this thread with my findings and hopefully in the very near future, solution.

 

CHBMB, I will tell you that I tried using the Dockerfile as is and installation instructions in the master branch and had absolutely 0 luck.

 

Master Branch: https://github.com/home-assistant/hadashboard

Install instructions: https://github.com/home-assistant/hadashboard#using-docker-non-raspian

 

Do not put anything in the volumes!

Link to comment

saarg and CHBMB thanks for your honesty.  CHBMB, let me get things configured in a manner where the file gets pulled into the volumes from the master branch for this project, per the link saarg provided.  From there I will document the steps I have taken to write a successful Dockerfile and got from there.  Dockers are great, but if you don't understand the in's and out's of them they are a royal pain.  Ultimately, that is my road block.  I know what I want to do, I don't always know how to do it and sometimes I have a hard time explaining it to others.  However, since there are a couple of others that have also spoken up about wanting this to work for them as well I will press on and continue updating this thread with my findings and hopefully in the very near future, solution.

 

CHBMB, I will tell you that I tried using the Dockerfile as is and installation instructions in the master branch and had absolutely 0 luck.

 

Master Branch: https://github.com/home-assistant/hadashboard

Install instructions: https://github.com/home-assistant/hadashboard#using-docker-non-raspian

 

Do not put anything in the volumes!

 

Pardon my ignorance. I have yet to read the link your provided and haven't been able to wrap my mind around volumes yet.

Link to comment

It is a slightly unusual way to get a docker up and running, as I understand it, you clone their github repository locally then build the docker container from that.  Then you seem to link that folder used to build the docker back into the image.  Then after that you need to configure it as per this link. https://github.com/home-assistant/hadashboard#configuring-the-dashboard-all-installations

 

Why they don't just create a container for you to use I'm not sure.

Link to comment
  • 3 weeks later...

Have a look at this dockerfile: https://hub.docker.com/r/marijngiesen/hadashboard/ This one is working.

 

This is/should be the exact same as what is in hadashboard github.  As marijngiesen was credited for creating it: 

 

Installation can be performed using Docker (Contributed by marijngiesen) 

 

However, I'll give it a looker over.

 

Edit:  Looked it over and interestingly enough the one you claim is working has the VOLUME(s) commented out:

 

1	1	  FROM ruby:2.2.5
2	2	  MAINTAINER Marijn Giesen <[email protected]>
3	3	  
4	4	  RUN apt-get update \
5	5	   && apt-get install -y \
6	6	        sqlite \
7	7	        nodejs \
8	8	        libpq-dev \
9	9	        libssl-dev \
10	10	        libsqlite3-dev \
11	11	        ruby-dev \
12	12	        python3 \
13	13	        python3-pip \
14	14	   && mkdir /app \
15	15	   && rm -rf /var/lib/apt/lists/*
16	16	  
17	17	  WORKDIR /app
18	18	  COPY . .
19	19	  
20	20	  RUN gem install dashing \
21	21	   && gem install bundler \
22	22	   && bundle \
23	23	   && pip3 install daemonize sseclient configobj \
24	24	   && pip3 install --upgrade requests
25	25	  
26	26	  
27	27	  EXPOSE 3030
28	28	  
29		- #VOLUME /app/lib /app/dashboards /app/hapush
29	+ VOLUME /app/lib /app/dashboards /app/hapush
30	30	  
31	31	  CMD /app/hapush/hapush.py -d /app/hapush/hapush.cfg && dashing start

 

So how are you modifying and moving dashboards and widgets?

Link to comment
  • 2 weeks later...
  • 2 months later...

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.