Install docker on Raspberry Pi

This is how I installed docker on Raspberry pi 5. First of all, before anything, I’d get a SD card with a sd usb adapter connected to my computer which I would install the installer which can be found over here. Then choose the Raspberry Pi OS. Choose to have SSH for your configure and remember your name for your Raspberry machine, username and password.

When we got our OS installed, connect it with Putty for example. Then in Putty connect to raspberrypi.local (if that is the name you gave). Then, update all your packages with:

  • sudo apt update
  • sudo apt upgrade

Then, install docker simply with

  • curl -sSL https://get.docker.com | sh

Then add your pi user to the docker group so you can access Docker fully.

  • sudo usermod -aG docker pi

Since we made changes to our current user, we need to logout & login again.

  • logout

Then type

  • groups

To see if the Docker group exist.

Then I had to actually do a reboot to get dockers deamon (dockerd) to work properly.

  • sudo reboot

Now let’s see if docker is working by connecting to the pi again then run,

  • docker run hello-world

Seems to be working!

Unity – Create a simple main menu

  1. First of all, create a new Scene by going to your Scenes folder under Assets and right click Create Scene. Name it something like MainMenu. While you’re at it, rename your main scene to something better if it’s named SampleScene to MainScene.
  2. Create a new GameObject under the UI category and choose Button.
  3. Go to the Text child object under the Button and Choose Text, change the Text from to something like Start Game like the picture below.
Main Menu in Unity
Start game button in Unity

4. Select the Button and Add Component, and select New Script, name it btnStart.

5. Double click on the btnStart script name to open up Visual Studio to start editing it, and add the following.

using UnityEngine;
using UnityEngine.UI;

public class btnStart : MonoBehaviour
{
    Button _btn;
    // Start is called before the first frame update
    void Start()
    {
        _btn = this.GetComponent<Button>();
        _btn.onClick.AddListener(TaskOnClick);
    }

    void TaskOnClick()
    {
        Debug.Log("You have clicked the button!");
    }
}

As you can see in the Console in Unity, we are now getting a log message when we click the button. We can now simple do whatever we want, such as go to our MainScene.

using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class btnStart : MonoBehaviour
{
    Button _btn;
    // Start is called before the first frame update
    void Start()
    {
        _btn = this.GetComponent<Button>();
        _btn.onClick.AddListener(TaskOnClick);
    }

    void TaskOnClick()
    {
        SceneManager.LoadScene("MainScene", LoadSceneMode.Single);
    }
}

If you get the error:

Scene ‘MainScene’ couldn’t be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settingsā€¦
UnityEngine.SceneManagement.SceneManager:LoadScene (string,UnityEngine.SceneManagement.LoadSceneMode)
btnStart:TaskOnClick () (at Assets/Scripts/btnStart.cs:17)
UnityEngine.EventSystems.EventSystem:Update ()

Then go to File in the top left, and select Build Settings… and click on Add Open Scenes for your MainMenu and MainScene.

That is the essentials of it! Now you can change up colors and make things more interesting of course. I thought about adding more to this tutorial but don’t think it’s necessary since it is kind of straight forward.