Install Docker in Raspberry Pi 4: Difference between revisions
Jump to navigation
Jump to search
Line 83: | Line 83: | ||
--opt com.docker.network.bridge.name=ckn.b00 ckn.b00 | --opt com.docker.network.bridge.name=ckn.b00 ckn.b00 | ||
</source> | </source> | ||
==Troubleshoot== | |||
{| | |||
| valign="top" | | |||
<source lang="bash"> | |||
docker run --rm --net=host busybox nslookup google.com | |||
docker run --rm --net=host alpine cat /etc/resolv.conf | |||
docker run --rm --net=host alpine nslookup google.com | |||
docker run --rm --net=host alpine ping google.com | |||
docker run --rm --net=host alpine cat /etc/hosts | |||
docker run --rm --net=host alpine ifconfig | |||
docker run --rm --net=host alpine ip addr | |||
docker run --rm --net=host alpine route | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
docker run --rm busybox nslookup google.com | |||
docker run --rm alpine cat /etc/resolv.conf | |||
docker run --rm alpine nslookup google.com | |||
docker run --rm alpine ping google.com | |||
docker run --rm alpine cat /etc/hosts | |||
docker run --rm alpine ifconfig | |||
docker run --rm alpine ip addr | |||
docker run --rm alpine route | |||
</source> | |||
|} | |||
== References == | == References == | ||
* [https://medium.com/@sipkeschoorstra/installing-docker-on-raspberry-pi-4-b010d3792b2d Installing Docker on Raspberry Pi 4] | * [https://medium.com/@sipkeschoorstra/installing-docker-on-raspberry-pi-4-b010d3792b2d Installing Docker on Raspberry Pi 4] | ||
* [https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl Installing Docker Compose on Raspberry Pi 4] | * [https://dev.to/rohansawant/installing-docker-and-docker-compose-on-the-raspberry-pi-in-5-simple-steps-3mgl Installing Docker Compose on Raspberry Pi 4] |
Revision as of 02:49, 3 January 2021
df -h
vcgencmd measure_temp
apt list --upgradable
apt upgrade
apt install openjdk-8-jdk/stable
apt install openjdk-11-jdk/stable
df -h
curl -sSL https://get.docker.com | sh
usermod -aG docker pi
docker --version
df -h
docker run hello-world
docker ps -a
docker images
apt install libffi-dev libssl-dev
apt install python3 python3-pip
apt remove python-configparser
pip3 install docker-compose
df -h
Networking
cat <<EOF > /etc/docker/daemon.json
{
"bip" : "10.20.13.1/24",
"mtu" : 1500,
"dns" : [
"10.19.83.100",
"10.19.83.1"
],
"debug": true
}
EOF
|
cat <<EOF > /etc/docker/daemon.json
{
"mtu" : 1500,
"debug" : true,
"experimental": false,
"default-address-pools" :[{
"base" : "10.20.0.0/16",
"size" : 24
}]
}
EOF
|
apt install -y iputils
iptables -t nat -S
service docker stop
service docker start
docker run --rm --detach --publish 1983:80 nginx
docker run --rm --detach --net=host nginx
docker run --rm --detach --publish 1983:80 --net=ckn.b00 --ip 10.20.15.10 nginx
docker run --rm --detach --publish 1983:80 --net=ckn.b01 --ip 10.20.16.10 nginx
Bridge
docker network create \
--driver bridge \
--gateway 10.20.15.1 \
--subnet 10.20.15.0/24 \
--opt com.docker.network.driver.mtu=1500 \
--opt com.docker.network.bridge.enable_icc=true \
--opt com.docker.network.bridge.enable_ip_masquerade=true \
--opt com.docker.network.bridge.host_binding_ipv4=0.0.0.0 \
--opt com.docker.network.bridge.name=ckn.b00 ckn.b00
Troubleshoot
docker run --rm --net=host busybox nslookup google.com
docker run --rm --net=host alpine cat /etc/resolv.conf
docker run --rm --net=host alpine nslookup google.com
docker run --rm --net=host alpine ping google.com
docker run --rm --net=host alpine cat /etc/hosts
docker run --rm --net=host alpine ifconfig
docker run --rm --net=host alpine ip addr
docker run --rm --net=host alpine route
|
docker run --rm busybox nslookup google.com
docker run --rm alpine cat /etc/resolv.conf
docker run --rm alpine nslookup google.com
docker run --rm alpine ping google.com
docker run --rm alpine cat /etc/hosts
docker run --rm alpine ifconfig
docker run --rm alpine ip addr
docker run --rm alpine route
|