-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added Dockerfile #5
Conversation
@@ -0,0 +1,8 @@ | |||
FROM python:3-buster | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to add LABEL maintainer=Yetangitu
here.
As said, I don't use Docker - the size of the image produced by your Dockerfile being one of the reasons for not doing so - so I; m not the one to ask whether this is the way to go. If it works for you I guess it'll work for others who want to use it? Fine by me, I can merge it. Go ahead and create the PR for the GH Action as well (or merge it in this PR), that being another thing I don't use - I tend to use my private repo and sort-of shun "the cloud" (i.e. someone else's computer) for most things. |
Sure, that's fair -- I could probably do more to squash the image and make it much smaller. I'll play around with it and see if I can. |
In regard to creating a PR for my Github Action, it relies on some secrets to be created -- namely $DOCKERHUB_USERNAME and $DOCKERHUB_TOKEN for the Action to work. So if I were to create a PR for it you would have to add those secrets for your own Docker Hub account -- which I assume you do not have as you are wary of using someone else's computer (which I completely understand). So perhaps it would be best to keep my action in my own repo and then if someone wants to use Docker you can point them to my Docker Hub image? However, if you are willing to create those secrets and a Docker Hub account I would be more than happy to PR my Github Action. |
I'll look into creating the docker-image locally and push it to the repo, that'd get around all these cloudy problems. If this turns out to be too much of a hassle we'll take one of those other routes. I will hold off merging this PR until I know what step to take next, right now I'm at the stage of |
I built a smaller image (using bitnami/minideb:bullseye) which seems to work just like the one created using your Dockerfile. It also shared the same problems in that it can not read the username/password from the command line:
...nor can it read it from a text file:
If it were to succeed in logging in it would still have problems storing data on the host since the host filesystem is not available in the container. This can be solved using a bind mount but all of these things require root permissions - as does running Docker itself. Given that all Linux distributions have a working Python environment it is questionable as to whether there is much benefit in running Spodcast through Docker, or am I missing something here? Anyway, I'll experiment a bit with bind-mounting an outside directory into the container so that Spodcast can do something useful. |
I rebased the image with Alpine from Debian and manually installing dependencies has reduced the image size from around 300+ MB to around 75MB. I think that's probably the smallest I can get it. In regard to avoiding cloudy stuff you can install buildx locally and then use QEMU to build multi-arch images. And since the repo is here on Github I think you could probably use Github's container repo to host the images and avoid Docker Hub. |
Now it seems to work:
Image size is 141MB. |
Whoops, I wrote my comment before I saw your comment that you rebased with I think if we go with my Alpine version it reduces it the most. Let me know what you think, I'm happy to go with either one. |
How does your image deal with hosting Spodcast-related data? What about the problem I encountered logging in? The bind-mounted version I just tested seems to work, are there other ways of doing this that you know of? |
I don't care whether it is Alpine or Debian, whatever works best. Seeing how Docker seems to work I assume users will save the most space by using a base image which is used by many other images - are there statistics on this to be found anywhere? |
I think that makes sense to specify the In regard to your question regarding mounting, I don't really seem to have a problem with my image in its current state -- here's how I'm running it on my server with the original, larger Debian based image (and it seems to work):
With your question on which image to base it on, I like Bitnami images and they are a verified publisher and as such are reliable but the However, one of the reasons I went with the Debian based Python image is because I have found it's a bit easier to maintain compared to Alpine (since Alpine comes with so little there is a lot that can be missing and can add extra steps for installing). So if you stick with Debian I think it'd be easier to maintain if changes are introduced down the road but with the Alpine image it will be smaller and it's coming from an official Docker Hub image. |
My personal opinion: use the official Python Alpine image. I've added 9519761 with the volume mount you specified and won't add anything more to the |
OK, if you can add a description (in README.md) of how to run the Docker image (w.r.t. it being interactive, needing a ptty, the bind mount and where to get it) I'll do some testing and merge if it all seems to work as intended. |
I totally can update the README with those instructions. Do you want me to write the instructions assuming the user will build the image locally? |
Add build instructions as well as a pointer to prebuilt images I'd say, just like the prebuilt pip install vs install from source. |
I added the instructions in the README -- hopefully the location made sense -- feel free to change anything. |
I'll add a LABEL with some related information to the Dockerfile |
Assumes that you will build the image from the root directory of the repository
i.e. (using my fork/branch as an example)
Then you can run the container like this:
Related, I've also created a Github Action to build a multi-architecture image and push it to Docker Hub: https://github.com/heywoodlh/actions/blob/master/.github/workflows/spodcast-buildx.yml
If you merge this pull request I will update my Action to point to your repo and continue building images at heywoodlh/spodcast on Docker Hub and I'm happy to keep building them on a weekly basis on my account -- but it'd be awesome if you had an official, cross-architecture image for Spodcast. Feel free to just take my Github Action and implement it here (or I can create a PR for that as well).
Let me know if that makes sense or if I can be of any help. Thanks for a great project!