Today I learned that docker creates an empty /.dockerenv file to indicate that you are running in a docker container. Other runtimes like podman commonly use /run/.containerenv. kubernetes uses neither of these, the most common way to detect if you are running in kubernetes is to check for the presence of the KUBERNETES_SERVICE_HOST environment variable. There will also be a directory at /var/run/secrets/kubernetes.io/serviceaccount that contains the service account credentials if you are running in kubernetes.
Posts tagged: docker
All posts with the tag "docker"
I learned to today that setting MEMORY on your minecraft server causes the JVM to egregiously allocate all of that memory. Not setting it causes slow downs and potential crashes, but setting INIT_MEMORY and MAX_MEMORY gives us the best of both worlds. It is allowed to use more, but does not gobble it all up on startup.
In this economy we need to save all the memory we can!
Here is a non-working snippet for a minecraft server deployment in kubernetes.
containers: - name: dungeon image: itzg/minecraft-server env: - name: EULA value: "true" - name: INIT_MEMORY value: "512M" - name: MAX_MEMORY value: "3G"
and in docker compose
Diun, looks like a very interesting tool to monitor for image updates, it does not make any change, it only makes notifications. This feels like an easy start to getting image updates started with low effort, keep git ops, but requires manual updates. I see this as a tool that would be a great start and pair well with automated image updaters to ensure they are working as expected.
I recently noticed that my og images were missing emoji. They were taken using headless chrome in a container. I fixed it by adding an emoji font in the containerfile / dockerfile.
RUN apt-get update && apt-get install -y \ # Add fonts with emoji support fonts-noto-color-emoji \ && rm -rf /var/lib/apt/lists/*
Before #
Here’s what they were looking like with broken emoji fonts.
And now with the fixed emoji font.
I put thought bubbles on my thoughts posts and stars on my github stars posts
Today I learned that the docs in postiz are a bit behind, (fantastic docs btw, they are to the point, and cover almost all of what you need). The docs state that you need to include an R2 bucket to handle uploads.
This issue shows that more work has been done, one of which is local storage. The compose file they use in the quick start has the required env variables to set this up.
STORAGE_PROVIDER: "local" UPLOAD_DIRECTORY: "/uploads" NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
looking into my running instance I can see my images there.
Dang context can really cause you to pull your hair out. Context seems so freaking convenient, but I’ve avoided it and just ssh in for these reasons. Maybe I’ll come around eventually but for now ssh is my friend.
Nice example of adding a healthcheck to fastapi, and integrating it with docker. Don’t forget to include curl in the install, nice touch.
bootc is the underlying technology that enables OS’s like bazzite, and Aurora from the uBlue ecosystem.
Hynek has a sick dockerfile setup for using uv in python projects.
This page is gold. It lays out all of the distrobox assemble api with some good examples of how to get access to things like podman and kind from inside of containers.
Especially this example.
Today I learned that you can use init_hooks to access host machine commands from inside a distrobox container. This is super handy for things that you cannot get to from inside the container and need ran outside (docker, podman, flatpak, xdg-open).
Docker no Docker, what!!!
So fly.io uses Dockerfiles to deploy your app, but no docker. They use containerd to download your docker images into firecracker microvms to run your app. Firecracker is the same tech that runs aws lambda functions.
Fascinating short post on the beans under the hood at fly.io and how they scale your app globally.
Great listen for anyone interested in productionizing python code with docker. Itamar brings up some
Don’t trust base images for security, upgrade your packages. Vulnerabilties become published and solved giving the bad guys istructions how to wreck your day and these fixes wont come to your docker application for up to two weeks due to image build tatency.
For job based containers pre-compile your pyc for faster startup.
Alpine linux is probably not what you want for python. Many packages such as postgres ship pre-copiled binaries that work for most linux distributions wich use glibc, but alpine uses musl so the binaries will be incompatable requiring you to need to install a bunch of build dependencies.
The convention of “z-pages” comes from google and reduces the likelihood of collisions with application endpoints and keep the convention across all applications.
I’ve been using this for a few weeks now and it’s fantastic. It’s reminds me of lazygit, it gives a nice quick interface into the things I need and it just works. Yes I can git status to see what changed, then diff the files, then commit hunks, but lazygit can do that in just a few keystrokes. lazydocker does this for docker. It gives me a nice view into whats running, what’s eating up disk space, and the networks I have. And if I see I have a bunch of exited containers, there is a bulk command righ there to clean them up.
tldr docker ps on steroids
Really cool tui to inspect docker imaages that runs with docker.
A very straightforward guide to moving your docker data, such as container storage to a different location. In my case I wanted it off of my boot drive.
On void linux. Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`. Change (for me lines 11-12) which say [registries.search] registries = [] to
[registries.search] registries = ['docker.io']
Without the above you won’t be able to use basic Various documentation (redhat blog entries, ... (drawn from https://www.projectatomic.io/blog/2018/05/podman-tls/)
podman functions. You might get errors like:man podman pages) say that dockerhub is a default, but without this step it’s clearly not.Good luck. Feel free to use the comment box below if you have a github account.
In my adventure to put more homelab in docker, I moved our modded minecraft setup to docker.
So far I have found all of our mods from curse forge. modpacks make getting multiple mods working together much easier, someone else has already vetted a pack of often times 100+ mods that all play well together. I have yet to get these working in docker, I will, but for not I just have individual mods.
under the hood docker is using wget to get the mod. The link you click on from curseforge will block wget. What I do is pop open the devtools (f12 in chrome), click on the network tab, click the download link on the web page, and watch the real link show up.
I am using docker compose, it makes the command much easier to start, and all...
...
I’ve ran a Minecraft server at home since December 2017 for me and my son to play on. We start a brand new one somewhere between every day and every week. The older he gets the longer the server lasts.
In all these years, I’ve been popping open the command line and running the server manually, and even inside of Digital Ocean occasionally to play a more public server with a friend.
My buddy Nic has been sharing me some of his homelab setup, and it’s really got me to thinking about what I can run at home, and Dockerizing all the things. Today I found a really sweet github repo that had a minecraft server running in docker with a pretty incredible setup.
I ended up running the first thing in the Readme that included a volume mount. If you are going to run this container, I HIGHLY reccomend that you make sure that you have your world volume mounted, otherwise it will die with your docker container.
...
📝 Docker Deep Dive - Notes
https://www.hanselminutes.com/784/doing-open-source-with-brian-douglas
A handy way to try weird things in docker is using play-with-docker. You get a four hour session for free, after four hours everything will be deleted, but you can start a new session.
Installing on Ubuntu.
...