fritzcollectd icon indicating copy to clipboard operation
fritzcollectd copied to clipboard

docker: Add Docker configuration

Open fetzerch opened this issue 6 years ago • 7 comments

This PR adds Docker configuration for fritzcollectd. Thanks @redm123, @lnxbil. I've mostly taken over your ideas with a few enhancements. Most noticeable is that when the image is used through docker-compose.yml, it's using the current development version (by mounting the python plugin file into the container). This helps me to quickly test changes to the plugin.

This closes #26, #29, #14.

fetzerch avatar Oct 13 '19 09:10 fetzerch

Coverage Status

Coverage remained the same at 100.0% when pulling 2b9356eed0e7a3435b8eec9e65381112138cdc75 on docker into 1368894e957eb743f76777707249dd2f50447713 on master.

coveralls avatar Oct 13 '19 09:10 coveralls

Coverage Status

Coverage remained the same at 100.0% when pulling 2b9356eed0e7a3435b8eec9e65381112138cdc75 on docker into 1368894e957eb743f76777707249dd2f50447713 on master.

coveralls avatar Oct 13 '19 09:10 coveralls

Sorry for the comment spam but I thought most of those are useful and prevent common mistakes and pitfalls. :)

Also to easily do dev you could just copy in the project at build time with good caching and tag release versions. Would solve one of my comments, too and is way cleaner. Let me know if you wan't some input or help with that.

SuperSandro2000 avatar Oct 13 '19 13:10 SuperSandro2000

I noticed an error that occurs with docker-compose. Can you confirm that? #37

DocBrown101 avatar Oct 13 '19 13:10 DocBrown101

@SuperSandro2000 Thanks for your valuable comments!

I guess I need to spend more time on the dev environment. Properly installing the project at build time caused a headache. I'm using pbr which automatically manages the project version (from git revisions). However doing an install requires git to be installed and the .git directory has to be copied into the container. I'll try to see if I find a better solution.

fetzerch avatar Oct 14 '19 05:10 fetzerch

I usually get git repos in docker container by one of those two ways:

RUN apk add git && git clone --depth=1 something /app && RUN pip3 install -r /app/requirements.txt && apk del git

or

COPY [ "requirements.txt", "/app/" ]
RUN pip3 install -r /app/requirements.txt
COPY [ ".", "/app/" ]

The second one is only good if you have the project in the same repo with the Dockerfiles cause otherwise you need to clone it beforehand with a script.

SuperSandro2000 avatar Oct 14 '19 20:10 SuperSandro2000

@fetzerch Have you been able to make progress, or do you need support?

DocBrown101 avatar Dec 25 '19 11:12 DocBrown101