Raspberry Pi(树莓派)安装Docker

Raspberry Pi 3 Model B+(树莓派3B+)

1.脚本安装 Docker

[email protected]:~ $ sudo curl -sSL https://get.docker.com | sh 
# Executing docker install script, commit: 442e66405c304fa92af8aadaa1d9b31bf4b0ad94 
+ sudo -E sh -c apt-get update -qq >/dev/null 
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null 
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | apt-key add -qq - >/dev/null 
Warning: apt-key output should not be parsed (stdout is not a terminal) 
+ sudo -E sh -c echo "deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable" > /etc/apt/sources.list.d/docker.list 
+ sudo -E sh -c apt-get update -qq >/dev/null 
+ [ -n  ] 
+ sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null 
+ sudo -E sh -c docker version 
Client: Docker Engine - Community  
Version:           19.03.8  
API version:       1.40  
Go version:        go1.12.17  
Git commit:        afacb8b  
Built:             Wed Mar 11 01:35:24 2020  
OS/Arch:           linux/arm  
Experimental:      false 

Server: Docker Engine - Community  
Engine:   
Version:          19.03.8   
API version:      1.40 (minimum version 1.12)   
Go version:       go1.12.17   
Git commit:       afacb8b   
Built:            Wed Mar 11 01:29:22 2020   
OS/Arch:          linux/arm   
Experimental:     false  
containerd:   
Version:          1.2.13   
GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429  
runc:   
Version:          1.0.0-rc10   
GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd  
docker-init:   
Version:          0.18.0   
GitCommit:        fec3683 
If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like:   

sudo usermod -aG docker pi 

Remember that you will have to log out and back in for this to take effect! 

WARNING: Adding a user to the "docker" group will grant the ability to run containers which can be used to obtain root privileges on the docker host.          
Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface for more information.    
[email protected]:~ $          

2.配置 Docker 图形化界面 portainer

下载 portainer

[email protected]:~ $ sudo docker pull portainer/portainer 
Using default tag: latest 
latest: Pulling from portainer/portainer 
d1e017099d17: Pull complete  
860ebb866910: Pull complete  
Digest:sha256:4ae7f14330b56ffc8728e63d355bc4bc7381417fa45ba0597e5dd32682901080 
Status: Downloaded newer image for portainer/portainer:latest docker.io/portainer/portainer:latest 
[email protected]:~ $ 

创建 portainer 容器

[email protected]:~ $  sudo docker volume create portainer_data  portainer_data  
[email protected]:~ $ 

运行 portainer

[email protected]:~ $ 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 
[email protected]:~ $ 

登录 portainer

Chromium 地址栏输入:Raspberry Pi’s IP:9000;
进入界面,选择:Local、Remote、Agent、Azure

3.Docker 安装 WordPress

[email protected]:~ $ sudo docker pull wordpress:latest 
latest: Pulling from library/wordpress 
fff3167bf8c7: Pull complete  
c1cd5cd61b6f: Pull complete  
45b7e5098979: Pull complete  
cd2e6e500bc1: Pull complete  
96129b300ee1: Pull complete  
9609adc074bd: Pull complete  
0c123cbb0206: Pull complete  
7e9265e50ef6: Pull complete  
cffb67dc105e: Pull complete  
be9f50d2a491: Pull complete  
6b8ce34ae73b: Pull complete  
04f1512b5fd1: Pull complete  
bb23a5632d14: Pull complete  
ce89f195267d: Pull complete  
427a49849600: Pull complete  
ecb08ed0b64d: Pull complete  
cc117aeb0b58: Pull complete  
7aeb94a748ac: Pull complete  
6a565d8ef5ad: Pull complete  
2d388a4916a8: Pull complete  
b7809cbf592e: Pull complete  
Digest:sha256:c852a4bf0d2200a5e5808dfe13e26e797710309b60208a6a8d21455004a2e753 
Status: Downloaded newer image for wordpress:latest docker.io/library/wordpress:latest  
[email protected]:~ $ 

4.Docker 安装 MySQL

[email protected]:~ $ sudo docker pull mysql:latest 
latest: Pulling from library/mysql 
no matching manifest for linux/arm/v7 in the manifest list entries 
[email protected]:~ $ 

报错了!

3B+ 架构不兼容,

解决方法:换,买新的树莓派4。✨

Read More

The Lover

回忆三张图之倒数第三张 – Chengdu 2019
《情人》
来自 π Day – 2018.3.14

补发,今天是2020年3月20日,我的表陪我3年+2天。

我爱我的表胜过一切。

Happy Valentine’s Day

《人类进化论:恋人小岛》 – 祝耕夫

你现在深爱的那个人…值得你信任吗…

《人类进化论:恋人小岛》 – 祝耕夫

某年某月的某一天,一男一女在一座与世隔绝的小岛醒来。

相爱还是相杀?两人能否活着逃出小岛?

在这个物欲横流的社会,单纯简单的恋爱似乎是件奢侈品,出轨会有负罪感吗?会愧疚吗?

何必百般心思测试另一半的忠心,一个人的情人节依然很快乐。

是谁?了解你的每一次呼吸每一次心跳。

在这个特别的日子里庆祝我的表表陪伴我三年减33天。

Read More