0

I created a small python application that automatically sends emails with some customization.

I want to distribute it in a way that is fairly easy for end users (i.e., general Windows and macOS users) to download and use.

I thought of bundling the app as a docker image, but I am running in technical problems.

The main one is that I rely on the yagmail library, which itself relies on the keyring library. It works great outside of docker, but within docker it’s a different story.

It requires a keyring backend that is usually installed by default on platforms. However, within the docker container, there is no keyring backend.

  1. I struggle to install a backend keyring in the docker without making a multi-GB image.

  2. Even once installed, it seems quite of a hassle if the end users have to re-enter their app specific password (as google requires it) again and again, every time they want to use the app. (I mean when they close/remove the docker container as they have no use for it during a week or so, and then relaunch it having to re-enter an app specific password.)

More broadly, I know docker would probably make it simpler for me to distribute the app to different platforms, but I wonder if for the end user it is the easiest to download/use the application. I’d like your take on it.

Here is my dockerfile for reference:

FROM python:3.10

WORKDIR /app

# RUN apt update -y && apt-get install -y kwalletmanager # This did not work

RUN pip3 install --no-cache-dir yagmail[all]

COPY iteramail.py .

CMD ["python3", "iteramail.py", "--help", "run", "--host=0.0.0.0"]
Louis.vgn
  • 149
  • 1
  • 1
  • 9
  • 1
    Docker is great for having cross-platform consistency, however, I think the fastest and easiest way for end consumers to run the app is to compile binaries for each OS which the end users can simply download and click on. It's also intuitive as it's the way 90% of all apps are distributed. If you do decide to compile I recommend using [Nuitka](https://github.com/Nuitka/Nuitka). It is a bit slow but I've encountered almost no issues with the binaries produced which I can't say of other Python compilers. – Squarish Jun 07 '23 at 22:02
  • You kind of confirm what I first thought. Thanks for your comment. Also, you really wouldn’t recommend pyinstaller compared to Nuitka? – Louis.vgn Jun 07 '23 at 22:39
  • 1
    Pyinstaller is more popular and it is faster, but Nuitka has proven to be far more reliable for me. – Squarish Jun 07 '23 at 22:55
  • 1
    cx freeze is also another option to consider if you are looking for more alternatives. – Squarish Jun 07 '23 at 22:56
  • @squarish thanks – Louis.vgn Jun 07 '23 at 23:37

0 Answers0