Anyone want to try this "nyancat" docker image? It's pretty big -- 23kIB. :^) (hub.docker.com)
from GustavoM@lemmy.world to linux@lemmy.ml on 23 Nov 2023 23:45
https://lemmy.world/post/8665422

Long, short story: CLI animation with some minor annoyances. “Handcrafted” most of em out of the .c file, followed by a bunch of gcc flags. Made it distroless, and this came up. Then my “sharing itch” started after checking the memory usage of the container at a whooping 0 bytes. (I know it must be way more than that, but still.). Just curious if I screwed something up or not. Also, c/Docker is really dead so I had to resort to you guys.

docker run -it --rm --log-driver none --net none --cap-drop=all --read-only --security-opt=no-new-privileges defnotgustavom/nyancat

Downvotes are to the left if you just don’t care and need that dopamine/self-validation hit, I guess. (Just saying since last time I shared a simple command, with code and all, and I got downvoted to oblivion plus my thread deleted for no apparent reason, so eh.)

#linux

threaded - newest

TootSweet@lemmy.world on 24 Nov 2023 00:13 next collapse

Works great on my Raspberry Pi 4! (Most Docker images don’t support arm64.)

GustavoM@lemmy.world on 24 Nov 2023 00:39 collapse

Glad to hear! Thanks.

TeryVeneno@lemmy.ml on 24 Nov 2023 03:33 next collapse

My downvotes are to the right 😩, I guess this means I gotta upvote

GustavoM@lemmy.world on 24 Nov 2023 14:06 collapse

Eh, that was meant to be a slight mockery for “ex-redditors” (since they are mostly composed of “downvote-happy” users).

TeryVeneno@lemmy.ml on 24 Nov 2023 18:26 collapse

I know, this comment was my silly way of saying I like what you’re doing.

GustavoM@lemmy.world on 24 Nov 2023 18:35 collapse

Oh. Thank you then. :p

blotz@lemmy.world on 24 Nov 2023 08:26 next collapse

Why wrap a CLI tool in a docker container? Wouldn’t it be simpler to directly compile nyancat to multiple architectures if the goal is to make it run on all platforms?

flashgnash@lemm.ee on 24 Nov 2023 10:57 next collapse

I would imagine it’s just to experiment with docker

FooBarrington@lemmy.world on 24 Nov 2023 11:25 next collapse

If you really wanted to, you could create an actually portable executable :)

brakenium@lemm.ee on 24 Nov 2023 15:53 collapse

That looks really interesting! Does this exist for other languages like Rust?

FooBarrington@lemmy.world on 24 Nov 2023 16:29 next collapse

Yes, some people tried it, and it seems to work: ahgamut.github.io/2022/07/27/ape-rust-example/

brakenium@lemm.ee on 24 Nov 2023 19:18 collapse

Very interesting, might have to check that out sometime

AnUnusualRelic@lemmy.world on 24 Nov 2023 20:54 collapse

Like go?

GustavoM@lemmy.world on 24 Nov 2023 14:04 collapse

Because I’m doing this as a “self-learning” process. Plus, docker is an excellent tool and even “silly” images like this one can give me an edge while looking for (more) jobs, so there’s that. Coding could grant me the same “edge” as well yes, but docker has “more value” since it requires you to code -AND- to have some knowledge/depth regarding typical “dockerization” processes.

andruid@lemmy.ml on 24 Nov 2023 20:38 collapse

Neat! What proccess did you follow for building distroless? I was using buildah, mounting dir, yum installing into the mount, and exporting that container off.

GustavoM@lemmy.world on 24 Nov 2023 21:00 collapse

Eh…the usual “FROM: alpine:edge”, pull everything in with git, change the code as needed, static compiling everything, strip dead code out of the binary, send the binary in a scratch image and then assigning a non-root user to it.