らいふうっどの閑話休題

興味のあることをゆる~く書いていく

shell で、Raspberry Pi OS 64bit に docker, docker-compose, node, npm をセットアップする話(改訂版)

f:id:ic_lifewood:20210206225739p:plain

shell で、Raspberry Pi OS 64bit に docker, docker-compose, node, npm をセットアップする話(改訂版)

lifewood.hatenablog.com

前回 E: Sub-process /usr/bin/dpkg returned an error code (1) 問題発生後の対応記事です。
結論から言うとエラー情報は無視をし、Raspberry Pi を再起動すれば、インストール完了になります。

Last time E: Sub-process / usr / bin / dpkg returned an error code (1) This is a corresponding article after the problem occurred.
In conclusion, ignore the error information and restart the Raspberry Pi to complete the installation.

npm, node インストール

echo "npm, node install  ----------------------------------"
nodeVer=12
nodeInstallCmd=`curl -sL https://deb.nodesource.com/setup_${nodeVer}.x | sudo -E bash -`
eval ${nodeInstallCmd}
sudo apt install nodejs -y
sudo npm install -g npm

docker インストール

echo "docker install  ----------------------------------"
dockerInstallCmd=`curl -sSL https://get.docker.com | sh`
eval ${dockerInstallCmd}

# Even if E: Sub-process / usr / bin / dpkg returned an error code (1) occurs, 
# the installation is complete.
echo "if E: Sub-process /usr/bin/dpkg returned an error code (1) occured"
echo "but Docker install OK Raspberry Pi reboot"

# user group add
echo "docker usermod  ----------------------------------"
sudo usermod -aG docker pi

# Reboot to complete docker installation
echo "reboot now  ----------------------------------"
sudo reboot

docker-compose インストール

echo "docker-compose install  ----------------------------------"
dockerInstallCmd=`sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose`
eval ${dockerInstallCmd}
sudo chmod +x /usr/local/bin/docker-compose

echo "docker-compose install  ----------------------------------"
docker-compose --version

Github

github.com