# Get Docker script
cd ~/Downloads
curl -fsSL https://get.docker.com -o get-docker.sh
sudo chmod +x get-docker.sh
./get-docker.sh
# Rootless
curl -fsSL https://get.docker.com/rootless -o rootless
sh rootless
# Restart, update, and add Docker user group
sudo restart now
sudo apt update && sudo apt upgrade -y
sudo apt-get update && sudo apt-get upgrade -y
sudo usermod -aG docker ${USER}
groups ${USER}
# Install necessary Python libs
python3 -V
which python3
sudo apt install apt-transport-https ca-certificates software-properties-common
sudo apt install python3-pip docker-compose
docker compose version
# Upgrade docker compose in PIP
sudo pip3 install --upgrade docker-compose
pip3 -V
# Use Rust to fix cryptography Python issue on Rasp Pi
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo pip3 install --upgrade docker-compose
rustc --version
rust --version
source "$HOME/.cargo/env"
rustc --version
pip3 install cryptography
sudo apt-get install -y libssl-dev
sudo pip3 install cryptography
pip3 install --updated pip
pip3 install --upgrade pip
Here's an explanation of the commands you used to fix the issue with Docker Compose on your Raspberry Pi:
curl -fsSL https://get.docker.com -o get-docker.sh
: This command downloads the Docker installation script (get-docker.sh) from https://get.docker.com using cURL.
sudo chmod +x get-docker.sh
: This command grants execute permissions to the Docker installation script.
./get-docker.sh
: This command runs the Docker installation script, which installs Docker on your Raspberry Pi.
curl -fsSL https://get.docker.com/rootless | sh
: This command downloads and executes the Docker rootless installation script. Running Docker in rootless mode allows non-root users to run Docker containers without requiring root privileges.
cat <<EOF | sudo sh -x apt-get install -y uidmap EOF
: This command uses a heredoc to pass the apt-get install command to the shell with root privileges. It installs the uidmap package, which is required for Docker rootless mode.
sudo shutdown now
: This command shuts down the Raspberry Pi. It might be part of the steps to ensure that Docker is fully installed and configured.
sudo apt update && sudo apt upgrade -y
: These commands update the package lists and upgrade all installed packages on the Raspberry Pi.
sudo apt-get update && sudo apt-get upgrade -y
: Similar to the previous command, these commands update the package lists and upgrade installed packages using apt-get.
groups ${USER}
: This command displays the groups that the current user (${USER}) belongs to. It's used to verify if the current user is part of the docker group, which is necessary for running Docker commands without sudo.
sudo usermod -aG docker ${USER}
: This command adds the current user to the docker group, allowing them to execute Docker commands without sudo.
sudo apt install apt-transport-https ca-certificates software-properties-common
: This command installs necessary packages for enabling HTTPS-based repositories and managing software properties.
sudo apt install docker-compose
: This command installs Docker Compose, a tool for defining and running multi-container Docker applications.
docker-compose build
: This command builds the services defined in the Docker Compose configuration file.
which docker-compose
: This command displays the path to the docker-compose executable, helping to verify if the installation was successful.
sudo pip3 install --upgrade docker-compose
: This command uses pip3 to install or upgrade the docker-compose Python package.
python3 -V
: This command displays the version of Python 3 installed on the Raspberry Pi.
which python3
: This command displays the path to the python3 executable.
sudo apt install python3-pip
: This command installs pip3, the package installer for Python 3.
pip3 -V
: This command displays the version of pip3 installed on the Raspberry Pi.
sudo pip3 install --upgrade docker-compose
: This command uses pip3 to install or upgrade the docker-compose package for Python 3.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
: This command downloads and executes the Rust installation script, which installs the Rust programming language on
It seems that Rust was needed, alongside other commands, to install Docker Compose.
To enable the swapfile (if not already enabled), you can run:
sudo dphys-swapfile setup
To change the swapfile size, edit the /etc/dphys-swapfile
configuration file and modify the CONF_SWAPSIZE
parameter:
sudo nano /etc/dphys-swapfile
Look for the line that looks like this and change the value (in MB):
# set size to absolute value, leaving empty (default) then uses computed value
# you most likely don't want this, unless you have an special disk situation
CONF_SWAPSIZE=1000
Change the CONF_SWAPSIZE
value to the desired size in megabytes (MB).
After making changes to the dphys-swapfile configuration, you can apply the changes by running:
sudo dphys-swapfile swapon
To disable the swapfile, you can run:
sudo dphys-swapfile swapoff
Check if the swap was increased with the free- h
command. You may need to reboot for swap changes to apply:
sudo reboot now
Please be cautious when modifying swap settings, as it can affect system performance and stability. Make sure you understand the implications of the changes you make to swap space on your Raspberry Pi.