Docker is a software platform designed to make it easier to create, deploy, and run applications by using containers. It offers OS-level virtualization to deliver software in packages called containers.
Docker compose is a tool for running multi-container applications on Docker.
Portainer is a lightweight management UI witch allows you to easily create, manage, and delete your Docker containers
Installation:
# 1. Pull the latest version:
sudo docker pull portainer/portainer-ce:latest
# 2. Run this container.
sudo docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
We define the ports we want Portainer to have access to, a name (“portainer”), and we also tell the Docker manager that we want to restart this Docker if it is ever unintentionally offline.
Use: Firstly, open your favorite browser and type the following:
http://[PI_ADDRESS]:9000 # If you don't remember your PI's IP address, type: hostname -I
Secondly, upon launching Portainer’s web interface, you will need to create an admin account.
What sort of container environment we want Portainer to manage? Select Docker. Click on Containers and you will be presented with a list of containers currently set up on your device. If you want to add a new one, click the Add container button.
If you have used Arch Linux, then you definitely know how easy it is to mess up your system. With containerized systems, you can create each one for a specific task.
sudo pacman -S distrobox podman # Distrobox allows you to create and manage containers on your favorite Linux distribution using either Docker or **Podman**.
You may have an error, “Cannot open display,” indicates that GIMP is unable to access the X server display. This issue typically arises when there’s a problem with X11 forwarding or permissions to access the X server.
sudo pacman -S xorg-xhost
vim .zshrc: xhost +si:localuser:$USER
Edit the .zshrc
file to include the command xhost +si:localuser:$USER
. It allows your user to access the X server using the xhost utility (sudo pacman -S xorg-xhost).
The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. This command grants permission to the current user to connect to the X server: xhost +si:localuser:$USE where the command consists: 1) xhost + 2) with local user authorization si:localuser:$USER
distrobox create -i archlinux # Create a Container from an Image
distrobox enter archlinux # Access a Distrobox Container, distrobox-enter --name container-name
sudo pacman -S vlc flameshot neofetch
sudo pacman -Syu gimp
sudo pacman -S libcanberra-pulse # A library that allows applications to play event sounds through the PulseAudio sound server by providing support for PulseAudio
You may want to directly run the commands on a Distrobox container instead of accessing the container. Exporting Applications from Container to Host. Access the container’s shell (distrobox-enter –name container-name – command), then distrobox-export ‐‐app name_app, e.g., distrobox-export ‐‐ app vlc.
distrobox stop archlinux # Stop an image.
distrobox create --name arch2--clone archlinux # Clone an image.
distrobox rm arch2 # Remove an image.
distrobox-list # List Images.
distrobox upgrade --all # Upgrade all images.