Raspberry Pi install docker and docker-compose
Address of this article: blog.lucien.ink/archives/518
Because the Raspberry Pi is always initialized frequently, the process of installing docker is also recorded.
1. Install docker
Due to some irresistible factors, it is strongly recommended to restart the system before installing docker.
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
2. Install docker-compose
In order not to destroy the python interpreter of the system, here we choose to install docker-compose in venv.
Of course, friends who don't mind this can skip the installation of venv and go directly to section 2.2.
2.1 Create and use venv
2.1.1 Install venv dependencies
apt install python3-venv -y
2.1.2 Create venv
Executing the following code will /venv
create a Python 3 virtual environment at .
python3 -m venv /venv
2.1.3 Using venv as the default interpreter
Append the following code to ~/.bashrc
the end of the .
source /venv/bin/activate
It will take effect the next time you log in.
2.2 Installation
You can refer to pip3 to change the source to make pip use the domestic mirror image.
pip install docker-compose