Author: sts

  • Docker – Step 2

    Docker – Step 2

    All aboard

    Raspberry Pis run a Linux Operating System, probably the most used OS in the world, and it’s open source, meaning (in general) anyone can use it, modify it and redistribute it, all for free.

    So far the software for my Pi shop has been completely free, there are opportunities to pay to support the developers, but no requirement to do so. WordPress, the software to create this site and used by almost half of all websites, is also free. It uses many plugins that are free in a minimalist version with desired features available in a paid version, but that’s a tale for another post, today’s is about Docker.

    Docker is a framework that sits on the OS (Windows, Mac, Linux) and supports containers. Containers hold isolated and secure installations of software apps & services. Prior to containerization of software & services there could be contention issues on libraries & resources, as well as security issues where malware could access data from other apps. By using containers these issues are no longer of concern. Software install and set up is fairly simple & standardized, after all, even I’ve been successful building my Pi shop.

    There are lots of people making YouTube videos and posting blogs that helped with guidance on my journey.
    One of the most helpful was Novaspirit Tech and their Pi Hosted series. The Github repository where the scripts and resources to setup and configure the self-hosted services mentioned in the videos are kept and you will become familiar with if you go down this path. This is also a great way to learn more about Docker, containers & Portainer, oh my.

    After installing Docker, which is a command line tool (CLI) the first container to install is Portainer, a GUI to manage Docker and the rest of the containers you will install.

    Pi hole is a network-wide ad blocking service and must have on every home network IMHO. Simply grab a few lists from the firebog collection to add to your Pi hole and you will see no more ads, yipee.

    If you watch the Pi-hosted series you will soon find that there are more than 200 free apps in the template to select from, with hundreds more on the docker hub (library) of container images. In subsequent posts I will identify the one’s I’ve selected to be on my home lab.

    Here is a sample Docker yaml script I’m using to install two containers; the first is piwigo, a photo display app, which depends on the 2nd container for the maria database to hold all the data for the photo album. There are some users, some port settings and some paths defined (volumes). This is typical of settings for every container in Docker.

    services:
      piwigo:
        image: lscr.io/linuxserver/piwigo:latest
        container_name: piwigo
        environment:
          - PUID=1000
          - PGID=1000
          - TZ=America/Los_Angeles
        volumes:
          - /portainer/Files/AppData/Config/piwigo/config:/config
          - /uppercrust/firstcut/Keepers:/gallery
        ports:
          - 8083:80
        restart: unless-stopped
        depends_on:
          - maria_db
    
      maria_db:
        image: linuxserver/mariadb:latest
        container_name: piwigo_db
        ports:
          - 3306:3306
        environment:
          - PUID=1000
          - PGID=1000
          - MYSQL_ROOT_PASSWORD=MySqlPassword
          - TZ=America/Los_Angeles
          - MYSQL_DATABASE=piwigo_db
          - MYSQL_USER=myuser
          - MYSQL_PASSWORD=mypassword
        volumes:
          - /portainer/Files/AppData/Config/piwigo/DB:/config
        restart: unless-stopped
    

    As you can see, not much to it and nothing to be intimidated by. If things don’t go right, or later you decide you want to change or remove it’s simply a matter of stopping the service and deleting the container. Modifying the script as needed and rerunning it will recreate the container with it’s software.

    Whether you are interested in monitoring your home (home automation) or your network (intrusion & threat detection) or your computer (CPU temp & activity) or serve your media, there is a free container that will help you do that.

  • First Steps

    First Steps

    Don’t reinvent the wheel.
    It’s probably been done before.
    Check YouTube.

    I wanted a way to show & share images across my local network without having to start my main PC. I started with 1 Raspberry Pi 5 (some assembly required); the free Raspberry PI Imager (OS); and some websites & YouTube channels for guidance.

    Little did I know the door that opened or how glad I’d be I took that first step. One unanticipated side benefit(?) is this website. It is operating on the first Pi, sitting on the corner of my office desk, sipping power and providing services 24×7, but that’s a story for later, this story is about getting that first Pi up and running.

    The Pi 5 is the first Pi with a PCIe bus that you can plug real storage hardware into, like SSDs. Thankfully Pis are well supported and have an active community. One Pi guru, Jeff Greeling has a great step by step tutorial on booting your Pi from an NVME drive or you can watch it on his YouTube channel

    At this point I had a Pi that could boot up and had lots of storage, but no apps and no way to access the storage. I knew I wanted to “show” my pictures from the Pi, but first I had to get them there.

    Some research showed that Samba was what I needed to drag and drop from my Windows PC to a file-share location on the Pi. One speed bump in this was finding out the hard way the ‘root’ user on the Pi, the first logged in user, cannot be used as the owner of the connection or storage target on the Pi, this is for security reasons; a new user is required.

    This is also a good time to point out that Linux has a totally different security structure for files and ownership & permissions. When something doesn’t go right, the first place to start is with permissions. Either the user doesn’t have permission to write to the location or doesn’t have permission to read or execute the file. These will stop you in your tracks every time.

    Thankfully, if an internet search or YouTube video doesn’t enlighten you there are a couple of personal assistants you can call on, they have been immensely helpful to me; Microsoft Copilot and Google Gemini.

    I’ve typed and spoken my queries; I’ve even taken screen shots with my cell phone and pasted the resulting image into the AI prompt. It was able to ‘read’ the lines of error code in the picture and tell me the problem and offer a solution.

    I’ve given it a few variables like database name, user and password and it will use those to produce a script to install an application.

    I would be much closer to my beginning steps than I am to my end steps without the help of AI. If you haven’t tried, download one of the apps from your app store and give it a whirl, much better than doom scrolling.