Trying to use a Dockerfile build environment from an open source project / Der Versuch, eine Build-Umgebung aus einem Dockerfile zu bauen

in #proofofbrain2 years ago

English version below


Hallo,

der Titel ist mir nicht hundertprozentig gelungen, mal schauen. Lasst mich euch eine kleine Geschichte erzählen. Heute habe ich auf der wundervollen rC3 einen wundervollen Vortrag gesehen: Potato Presenter. Später, nach Ende des Events, vermutlich am Titel zu finden unter https://media.ccc.de/c/rc3-2021. Dabei ging es um die gleichnamige Software, Github Page https://github.com/thgier/PotatoPresenter/, Homepage https://potato-presenter.de/, welche folgendes ermöglicht: Du schreibst, in einem simplen, an LaTeX angelehnten Syntax - der aber auch tolle Dinge wie CSS und Markdown kann - ein grundlegendes Präsentationslayout. Und mit Layout meine ich nur Folien und ihre Inhalte, nicht deren Position und Layout - Ok, der Satz ist mir auch eher mäßig gelungen. Jedenfalls legst du im Markdown nur die Inhalte fest und dann, in einem zweiten Schritt, werden die Inhalte gerendert und Du kannst sie grafisch auf den Folien positionieren. Die Software spuckt daraufhin ein PDF aus.

Von der Website ein Screenshot geklaut:

(Ehrlich, die Website erklärt es noch besser als ich, also klickt da mal drauf! https://potato-presenter.de/

Jedenfalls hat mich das Konzept sofort ergriffen, als genial und revolutionär und Powerpoint deinstallierend quasi. Die Geschichte, die ich euch nun erzähle, schmälert auch in keinster Weise die Arbeit der Autor*in, der ich wirklich dankbar bin für den innovativen "take on presentation software". Trotzdem ist mir beim Versuch, die Software selber zu kompilieren, ein Dockerfile untergekommen, welches einfach nicht einmal annähernd funktioniert hat und meinem zugegebenermaßen beschränkten Wissens, was Dockerfiles angeht, auch in keiner Docker-Version je hätte funktionieren können. Das hatte meine Freude anfangs ein wenig geschmälert, danach habe ich allerdings festgestellt, das auf der Github-Seite doch fertige Binaries zu finden sind, und konnte die Software dann ausführen. Trotzdem hatte mich der Ehrgeiz gepackt, und ich machte mich daran, das Dockerfile zu überarbeiten.

https://github.com/thgier/PotatoPresenter/blob/master/Dockerfile
(Originales Dockerfile)

Zur Information: Ein Dockerfile ist in diesem Zusammenhang ein meines Erachtens nach hervorragender Ansatz, eine reproduzierbare Build-Umgebung zur Verfügung zu stellen. Dockerfiles sind quasi Anleitungen, um in einem isolierten "Container" ein Sub-Betriebsystem mit Programmen und Einstellungen aufzubauen, häufig verwendet, um Software mit benötigten Diensten auszuliefern als eine Art "Snapshot" eines Systems, bloß nicht wie ein Snapshot in einer VM-Software, sondern wie gesagt als Anleitung, wie ein konfiguriertes System zu bauen ist, und diese Anleitung ist sehr maschinenlesbar.

Man kann aber diese Anleitungen, diese Rezepte auch verwenden, um eine Entwicklungsumgebung, quasi einen Rechner mit installierten Abhängigkeiten, Bibliotheken, Compilern und dem Source Code des betreffenden Projekts, aufzubauen, sodass man interessierten Nutzern der Software dieses Rezept mitgibt (, welches maximal wenige Kilobytes groß ist), und deren Computer dann genau weiß, wie er sich in den nötigen Zustand versetzt, um die Software zu bauen.

Wie gesagt, klasse Ansatz, würde mir wünschen, mehr Entwickler von mir genutzter Software würden das tun. Würde mir nicht zu verachtende Mengen an Arbeit sparen. Aber dieses Dockerfile war irgendwie überhaupt nicht nutzbar. Die einzelnen Befehle haben gepasst und ich habe auch sofort verstanden, was versucht wurde zu machen, aber die Docker-spezifischen Sachen waren so falsch, dass ich die starke Vermutung habe, dass ein Shell-Skript einfach gecopypasted wurde, ohne das Ergebnis zu testen.

Wenn ich morgen Zeit finde, gehe ich meine Änderungen mit euch durch, denn ich habe schon beinahe eine lauffähige Version, und ich plane auch fest, diese demder Autorin zur Verfügung zu stellen.

Tschüss


English version


Hello,

I didn't get the title one hundred percent right, let's see. Let me tell you a little story. Today I saw a wonderful presentation at the wonderful rC3: Potato Presenter. Later, after the event ends, probably to be found by the title at https://media.ccc.de/c/rc3-2021 It was about the software of the same name, Github Page https://github.com/thgier/PotatoPresenter/, Homepage https://potato-presenter.de/, which allows you to do the following: you write, in a simple LaTeX-like syntax - but which can also do great things like CSS and Markdown - a basic presentation layout. And by layout I mean only slides and their contents, not their position and layout - Ok, that sentence is also rather mediocre for me. Anyway, in Markdown you just specify the content and then, in a second step, the content is rendered and you can position it graphically on the slides. The software then spits out a PDF.

A screenshot stolen from the website:

(Honestly, the website explains it even better than I do, so click on it! https://potato-presenter.de/

Anyway, the concept immediately grabbed me, as ingenious and revolutionary and uninstalling Powerpoint, so to speak. The story I'm about to tell you also in no way detracts from the work of the author, to whom I am truly grateful for the innovative "take on presentation software". Nevertheless, while trying to compile the software myself, I ran into a Dockerfile that simply didn't even come close to working and, to my admittedly limited knowledge of Dockerfiles, could never have worked in any Docker version. This dampened my joy a bit at first, but then I found that there are ready-made binaries on the Github site and was able to run the software. Nevertheless, my ambition got the better of me and I started to rework the Dockerfile.

https://github.com/thgier/PotatoPresenter/blob/master/Dockerfile
(Original Dockerfile)

For the record, a Dockerfile in this context is what I think is an excellent approach to providing a reproducible build environment. Dockerfiles are sort of instructions to build a sub-operating system with programs and settings in an isolated "container", often used to ship software with required services as a sort of "snapshot" of a system, just not like a snapshot in a VM software, but as I said, as instructions on how to build a configured system, and these instructions are very machine readable.

One can use however these instructions, these recipes also, in order to build a development environment, quasi a computer with installed dependencies, libraries, compilers and the source code of the project concerned, so that one gives to interested users of the software this recipe (, which is at most few kilobytes large), and their computer then exactly knows, how it sets itself into the necessary condition, in order to build the software.

As I said, great approach, wish more developers of software I use would do this. Would save me no small amount of work. But this Dockerfile was somehow not usable at all. The individual commands fit and I understood what was trying to do right away, but the Docker-specific stuff was so wrong that I have a strong suspicion that a shell script was simply copypasted without testing the result.

If I find time tomorrow, I'll go over my changes with you, because I almost have a runnable version already, and I also firmly plan to provide it to the author*.

Bye