Today's Problem:
Today's task for #100DaysOfHomelab was to re-spin up my custom discord bot that I've developed. As my eventual summary of my Days 1-7 post will entail, I completely wiped all 3 of my hypervisors on Day -1 (0?, not sure how these days are indexed). These were previously running Proxmox but, due to my problems with it and a convincing video by Lawrence Systems, I moved to XCP-ng. Unfortunately, this left all my services completely wiped, with only some backups. One of these down services was my discord bot. It's nothing fancy, just a python script that connects to a postgres database. Semi-recently moved it to docker container, but when I wiped the VM I thought 'oh, worst case just regenerate it since I have the dockerfile'. When going back to my script, I realized a few configuration variables had changed and my docker image definitely needed to be rebuilt, regardless of if I already had the old image.
A quick google of all the docker commands I needed and I set off with the wrong docker build command. Portainer refused to import my image, and it refused to run the image after a manual import through the docker command. I tried running the image on my laptop, where I was building the docker image, and no dice there either. After quite a bit of trial and error, I found the problem: I wasn't tagging my image. Apparently, both Docker for Mac and Portainer both hate trying to run un-tagged images. I guess everything needs a tag. On the last image, I'd previously built it with a tag, but I'd not documented my process and as a result got to re-learn how to build my docker image the hard way.
In case anyone is as inxexperienced as me (and definitely not me saving this for myslef later), the correct commands to build my docker image were:
$ docker build -t example/example:1.0 .
$ docker save example/example:1.0 > example.tar
This tar file uploaded directly into portainer, no issue, and I got my discord bot up and running.
Future steps for this discord bot would be to get a CI/CD pipeline running to auto-build and deploy this image, as well as some overall structural improvements to my release process and the image itself. 1G for a python bot is a lot of bloat, but I'm not lacking in storage space currently.