Docker Swarm Portainer Notes
Docker certificate signed by unknown authority
While attempting to build a clone of a Harbor Registry Installation for testing an upgrade/migration, my new Debian 12 Docker installation was reporting Error response from daemon: Get "https://registry.local/v2/": tls: failed to verify certificate: x509: certificate signed by unknown authority which was stopping me from logging in and performing any push/pull of images.
CA & Harbor Certificates
- mkdir /opt/harbor/certs
- cd /opt/harbor/certs
- openssl genrsa -out ca.key 4096
- openssl req -x509 -new -nodes -sha512 -days 3650 -subj "/C=CN/ST=London/L=London/O=myCompany/OU=Registry/CN=registry.local" -key ca.key -out ca.crt
- openssl genrsa -out registry.local.key 4096
- openssl req -sha512 -new -subj "/C=CN/ST=London/L=London/O=myCompany/OU=Registry/CN=registry.local" -key registry.local.key -out registry.local.csr
- cat > v3.ext <<-EOF
authorityKeyIdentifier=keyid,issuerbasicConstraints=CA:FALSEkeyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEnciphermentextendedKeyUsage = serverAuthsubjectAltName = @alt_names[alt_names]DNS.1=registry.localEOF
- openssl x509 -req -sha512 -days 3650 -extfile v3.ext -CA ca.crt -CAkey ca.key -CAcreateserial -in registry.local.csr -out registry.local.crt
- openssl x509 -inform PEM -in registry.local.crt -out registry.local.cert
- cd /etc/docker/certs.d/registry.local\:443/
- Remove any existing certificate / keys from the folder.
- cd /opt/harbor/certs
- cp registry.local.cert /etc/docker/certs.d/registry.local\:443/
- cp registry.local.key /etc/docker/certs.d/registry.local\:443/
- cp ca.crt /etc/docker/certs.d/registry.local\:443/
Update CA Certificates
- Save the cert to the file , like the command above (the port is crucial, no need for the protocol)Copy from above which will be in /etc/docker/certs.d/<registry>:<port>/ca.crt
- copy it to /usr/local/share/ca-certificates/: sudo cp ca.crt /usr/local/share/ca-certificates/
- run update-ca-certificates: sudo update-ca-certificates
Apply new certs:
- cd /opt/registry/harbor/
- ./prepare --with-trivy --with-clair
Update Docker Daemon to add an insecure registry (i.e. self signed).
- vi /etc/docker/daemon.json
{"insecure-registries" : ["registry.local:443"]}
Restart Docker
- systemctl restart docker
- openssl s_client -showcerts -connect registry.local:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
- cat /opt/registry/certs/registry.local.cert
- Certificates should match.
Docker Login
- docker login registry.local
Debian GNU/Linux 12 (bookworm)
Trying to build a Node/Lab for Docker Orchestration learning, I've built a ZP-0088 Rack Tower containing 4 x PI4's and applied the latest Raspbian (DEBIAN 12) O/S Lite and firmware rpi-6.6.y at the time of writing.
Network Configuration
Reset back to blank state:
- Connect directly to the Raspberry PI
- Remove existing network configuration from /etc/wpa_supplicant/wpa_supplicant.conf
- Remove existing network configuration from /etc/network/interfaces
- Remove existing network connection files from /etc/NetworkManager/system-connections/
- Update manged=true in /etc/NetworkManager/NetworkManager.conf.
- Reboot
Apply Network Configurations:
EASY WIFI Method:
- Run raspi-confi, system options, Wireless LAN and configure SSID and Password and no configuration error reported (as any conflicting configurations were removed above).
- Reboot
- Automatic IP Address (DHCP) over wifi should now be configured
Manually Configure WIFI
- Show connection status, run: nmcli dev status
- If your unsure your wifi is enabled, your can run : nmcli radio wifi
- If disabled run: nmcli radio wifi on
- Scan available wifi networks, run: nmcli dev wifi list
- Connect to the wifi: nmcli dev wifi connect <network-ssid> password <network-password>
- Connection will be made and IP automatically assigned by DHCP.
- Test connection using ping: ping google.co.uk
- Check connection using: ip r
- New configuration file added to /etc/NetworkManager/system-connections/
Update WIFI for Static IP
- Edit your WIFI configuration file: vi /etc/NetworkManager/system-connections/<SSID>.nmconnection
- Update the [ipv4] section from DHCP
[ipv4]
method=auto
- to a STATIC IP Address.
[ipv4]address1=192.168.1.2/24,192.168.1.1dns=192.168.1.1method=manual
- Reboot or Restart Network Manager: systemctl restart NetworkManager
- View Service Log if any issues: journalctl -u NetworkManager.service.
Add Wired STATIC IP Wired Connection
- Show connection status to find Wired Connection name: nmcli conn show
- Modify connection for a static IP address, change connection name if differs: nmcli con mod "Wired connection 1" ipv4.addresses "192.168.1.3/24" ipv4.gateway "192.168.1.1" ipv4.dns "192.168.1.1" ipv4.method "manual"
- List /etc/NetworkManager/system-connections/ files shows new configuration file.
- Reboot or Restart Network Manager: systemctl restart NetworkManager
- List configured IP Addresses using:
- ip r
- ifconfig
RaspberryPi: 11.RetroPie Standalone Build
RetroPie ZX Spectrum / Z80
The following instructions are used as a guide for setting up the Sinclair ZX Spectrum and Z80 in RetroPie / Emulation Station.
On Windows Device:
- Download Sinclair Roms to a temporary location... C:\SinclairRoms\RomName1.tap
C:\SinclairRoms\RomName2.z80
- Copy Roms TAP and Z80 (C:\SinclairRoms\*) to \\RETROPIE\roms\zxspectrum\
Troubleshooting
- SELECT + START to exit emulator and return to Emulation Station.
- If ROM fails to load, Press 'A' button at launch screen to switch Emulator.
- SELECT displays on-screen keyboard.
RetroPie Atari 2600
The following instructions are used as a guide for setting up the Atari 2600 in RetroPie / Emulation Station.
On Windows Device:
- Download Atari 2600 roms to a temporary location and decompress... C:\Atari2600Roms\RomName2.a26
- Copy roms (C:\Atari2600Roms\*) to \\RETROPIE\roms\atari2600\
Troubleshooting
- SELECT + START to exit emulator and return to Emulation Station.
RetroPie Atari 7800
The following instructions are used as a guide for setting up the Atari 7800 in RetroPie / Emulation Station.
On Windows Device:
- Download Sinclair Roms to a temporary location and decompress... C:\Atari7800Roms\RomName2.a78
- Copy roms (C:\Atari7800Roms\*) to \\RETROPIE\roms\atari7800\
Troubleshooting
- SELECT + START to exit emulator and return to Emulation Station.
RetroPie Amstrad CPC
The following instructions are used as a guide for setting up the Amstrad Colour Personal Computer in RetroPie / Emulation Station.
On Windows Device:
- Download Amstrad CPC Roms to a temporary location and decompress... C:\AmstradCPCRoms\a\aRomName1.dsk
C:\AmstradCPCRoms\a\aRomName2.dsk
C:\AmstradCPCRoms\a\aRomName3.dsk
C:\AmstradCPCRoms\b\bRomName1.dsk
C:\AmstradCPCRoms\b\bRomName2.dsk
C:\AmstradCPCRoms\c\cRomName1.dsk
- Copy roms (C:\AmstradCPCRoms\*) to \\RETROPIE\roms\amstradcpc\, emulation station excepts subfolders for grouping of roms (i.e. a, b, c, etc).
Troubleshooting
- SELECT + START to exit emulator and return to Emulation Station.
- Keyboard Controlled.
RaspberryPi: 10.RetroPie Standalone Build
RetroPie Megadrive
The following instructions are used as a guide for setting up the SEGA Megadrive (Genesis - USA) in RetroPie / Emulation Station.
On Windows Device:
- Download SEGA MegaDrive Roms to a temporary location... C:\MegadriveRoms\RomName1.7z
C:\MegadriveRoms\RomName2.7z
- Roms compressed with 7 Zip are not recognised by RetroPie, this will need converting to regular ZIP compressed files.
- Open WinRAR, in the address bar enter the Megadrive ROM Folder (i.e. C:\MegadriveRoms).
- Press CTRL+A to select all ROM files.
- From the 'Tools' tab, select convert archives.
- Press 'Conversion' button and select ZIP Archive Format, press 'OK'
- Tick 'Delete original archives'.
- Press 'OK' to start conversion process.
- Click 'Close' when the conversion process is done.
- Close WinRAR.
- Files should now be all ZIP Compressed archives. which is recognised by Emulation Station... C:\MegadriveRoms\RomName1.zip
C:\MegadriveRoms\RomName2.zip
- Copy Roms (C:\MegadriveRoms\*) to \\RETROPIE\roms\megadrive\
Reboot RaspberryPi
The following instructions are used reboot the RaspberryPi to activate changes made.
On Terminal Emulator:
- Enter the following command to reboot the RaspberryPi... sudo shutdown -r now 'Maintenance Reboot'
Troubleshooting
- SELECT + START to exit emulator and return to EmulationStation.
- If ROM fails to load, Press 'A' button at launch screen to switch GBA Emulator.
RaspberryPi: 9.RetroPie Standalone Build
RetroPie GameBoy Advance
The following instructions are used as a guide for setting up GameBoy Advance in RetroPie / Emulation Station.
On Windows Device:
- Download Gameboy Advance Bios (gba_bios.bin) and copy to \\RETROPIE\bios\
- Download GameBoy Advance Roms to a temporary location... C:\GBARoms\AllRoms\GBAXXXX-XXXX\GBA Roms XXXX - XXXX\XXXX - RomName (J)(Provider).zip
C:\GBARoms\AllRoms\GBAXXXX-XXXX\GBA Roms XXXX - XXXX\XXXX - RomName (E)(Provider).zip
C:\GBARoms\AllRoms\GBAXXXX-XXXX\GBA Roms XXXX - XXXX\XXXX - RomName (U)(Provider).zip
C:\GBARoms\AllRoms\GBAXXXX-XXXX\GBA Roms XXXX - XXXX\XXXX - RomName (F)(Provider).zip
- In Windows PowerShell ISE run the following command to extract English (USA & European) Titles only... Get-ChildItem "C:\GBARoms\AllRoms\*" -Recurse -Include "*(U)*", "*(E)*" | Copy-Item -Destination "C:\GBARoms\EnglishRoms\"
- Copy Roms (C:\GBARoms\EnglishRoms\*) to \\RETROPIE\roms\gba\
Reboot RaspberryPi
The following instructions are used reboot the RaspberryPi to activate changes made.
On Terminal Emulator:
- Enter the following command to reboot the RaspberryPi... sudo shutdown -r now 'Maintenance Reboot'
Troubleshooting
- SELECT + START to exit emulator and return to EmulationStation.
- If ROM fails to load, Press 'A' button at launch screen to switch GBA Emulator.
RaspberryPi: 8.RetroPie Standalone Build
RetroPie KODI (Ports) Setup
The following instructions are used to setup Kodi Media Center for access directly from RetroPie Emulation Station.
On RaspberryPi:
- In RetroPie Menu, use DPad to scroll up & down, highlight 'RETROPIE SETUP' and press 'A' button.
- Use DPad, highlight 'Manage packages' and press 'X' button to select.
- Use DPad, highlight 'Manage Optional packages' and press 'X' button to select.
- Use DPad, highlight 'Kodi' and press 'X' button to select.
- Use DPad, highlight 'Install from binary' and press 'X' button to select.
- Use DPad, highlight 'Exit' and press 'X' button to confirm.
- Repeat back out until at main RetroPie Setup menu.
- Use DPad, highlight 'Perform reboot' and press 'X' button to select.
- Use DPad, highlight 'Yes' and press 'X' button to confirm.
- Use DPad, select 'PORTS' menu and press 'A' button to enter.
- Use DPad, highlight 'KODI' and press 'A' button to select.
KODI Media Center
KODI Controls: Controller DPad + 'X' to SELECT and 'A' to back out.
RaspberryPi: 7.RetroPie Standalone Build
TL-WN725N N300 Mini WiFi Driver Installation & Setup
The following instructions are used to install and configure the TL-WN725 (Version 2.0) N300 Mini WiFi Driver. If you don't have this specific WiFi adapter this can be skipped.
Credit goes to MrEngman for providing up-to-date drivers for this adapter.
On Terminal Emulator:
- Enter the following commands to update the Raspbian O/S... sudo curl https://dl.dropboxusercontent.com/u/80256631/install-wifi.tar.gz | tar xz
sudo ./install-wifi
- Enter the following command to reboot the RaspberryPi... sudo shutdown -r now 'Maintenance Reboot'
RetroPie WiFi Setup
The following instructions are used to configure a WiFi Adapter from within RetroPie.
On RaspberryPi:
- In RetroPie Menu, use DPad to scroll up & down, highlight 'WIFI' and press 'A' button.
- Use DPad, highlight 'Connect to WiFi network' and press 'X' to select.
- Use DPad, highlight your WiFi SSID and press 'X' to select.
- Enter WiFi Password and press 'x' to continue, if connection is successful ESSID will display your WiFi SSID.
- Use DPad, highlight 'Exit' and press 'X' to confirm.
- The Ethernet Cable can now be disconnected from the RaspberryPi.
Show WiFi IP Address
The following instructions will show you how to display the RaspberryPi IP Address.
On RaspberryPi:
- In RetroPie Menu, use DPad to scroll up & down, highlight 'SHOW IP' and press 'A' button.
- Record WiFi IP Address, this is required for SSH access from remote machines (i.e. Windows Device).
- Press 'A' to select OK to return to Emulation Station - RetroPie Menu Options.
RaspberryPi: 6.RetroPie Standalone Build
Update RetroPie
The following instructions will update the RetroPie Setup script and Package Update.
On RaspberryPi:
- In RetroPie Menu, use DPad to scroll up & down, highlight 'RETROPIE SETUP' and press 'A' button.
- Press 'X' button at the notice screen.
- Use DPad, highlight 'Update all installed packages' and press 'X' button.
- Use DPad, highlight 'Yes' and press 'X' button.
- Press 'X' button to acknowledge RetroPie-Script update.
- Press 'X' button at the notice screen.
- Use DPad, highlight 'Yes' and press 'X' button to update underlying OS Packages.
- Wait for updates to complete...
- Press 'X' to acknowledge packages have been updated.
- Use DPad, highlight 'Perform reboot' and press 'X' button.
- Use DPad, highlight 'Yes' and press 'X' button to confirm reboot.
FIX : DragonRise Inc. Generic USB Controller Issue - After RetroPie Update
Following the RetroPie update the controller stopped working when navigating up & down using the DPad.The controller name and the DPad up & down values have changed.
On RaspberryPi:
- In RetroPie Menu, use DPad and attempt to scroll up & down through the menu options.
- If DPad Up & Down not responding, choose one of the following methods...
Method 1 - Reconfigure using RetroPie Console
This can be reconfigured on this specific controller by pressing the 'KXD' button and then using the Right Axis joystick instead of the DPad, you can then reconfigure the controller by pressing the 'START' button and selecting 'Configure Input'. Before repeating the controller reconfiguration process, turn off the 'KXD' button.
Method 2 - Update configuration files on Terminal Emulator
- Enter the following commands to setup the correct controller configuration file... cd /opt/retropie/configs/all/retroarch/autoconfig
mv 'DragonRiseInc.GenericUSBJoystick.cfg' 'DragonRiseInc.GenericUSBJoystick.cfg.bak'
touch 'DragonRise Inc. Generic USB Joystick .cfg'
nano 'DragonRise Inc. Generic USB Joystick .cfg'
- Add the following configuration. input_device = "DragonRise Inc. Generic USB Joystick "
input_driver = "udev"
input_r_y_plus_axis = "-2"
input_l3_btn = "10"
input_l_btn = "4"
input_load_state_btn = "4"
input_start_btn = "9"
input_exit_emulator_btn = "9"
input_up_axis = "-1"
input_a_btn = "1"
input_b_btn = "2"
input_reset_btn = "2"
input_down_axis = "+1"
input_r_btn = "5"
input_save_state_btn = "5"
input_r2_btn = "7"
input_r3_btn = "11"
input_right_axis = "+0"
input_state_slot_increase_axis = "+0"
input_x_btn = "0"
input_menu_toggle_btn = "0"
input_select_btn = "8"
input_enable_hotkey_btn = "8"
input_y_btn = "3"
input_left_axis = "-0"
input_state_slot_decrease_axis = "-0"
input_l2_btn = "6"
- Press 'CTRL+x' and then press 'Y' to confirm save.
- Press 'ENTER' to keep exisiting filename.
- Navigate to RetroArch Auto Configuration directory... cp 'DragonRise Inc. Generic USB Joystick .cfg' 'DragonRise Inc. Generic USB Joystick .cfg.bak'
sudo reboot