안녕하세요,
위 가이드에 따라 D3-G 보드(Headless Ubuntu)에 Docker Engine을 설치하여 테스트를 하고 있습니다.
그런데, default network인 Bridge Network를 사용하기에 필요한 커널 모듈들이 없는 것 같습니다. (아래 모듈 리스트는 ChatGPT를 통해 얻은 정보이므로 틀릴 수 있습니다.)
- ip_tables
- iptable_raw
- iptable_filter
- iptable_nat
- iptable_mangle
그래서 처음 docker engine 설치 후, 아래와 같이 결과가 나옵니다.
root@TOPST:~# sudo docker run --rm hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Run 'docker run --help' for more information
root@TOPST:~#
아래와 같이 Docker 데몬 설정을 변경하여 iptables와 bridge network를 사용하지 않도록 하여 실행하면 정상 동작이 됩니다.
# Docker 서비스 중지
sudo systemctl stop docker
# Docker 데몬 설정 파일 생성/수정
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json > /dev/null <<EOF
{
"iptables": false,
"bridge": "none"
}
EOF
# Docker 서비스 재시작
sudo systemctl start docker
아래는 그 후 정상 동작되는 모습입니다.
root@TOPST:~# sudo docker run --rm hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
root@TOPST:~#
아래는 host 모드로 네트워크 사용시 정상 작동하고, bridge 모드로 네트워크 사용시 되지 않는 모습입니다.(위와 같이 daemon.json 파일 설정 후)
root@TOPST:~# sudo docker run --rm --network host alpine ping -c 3 google.com
PING google.com (172.217.25.174): 56 data bytes
64 bytes from 172.217.25.174: seq=0 ttl=117 time=33.081 ms
64 bytes from 172.217.25.174: seq=1 ttl=117 time=33.243 ms
64 bytes from 172.217.25.174: seq=2 ttl=117 time=33.462 ms
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 33.081/33.262/33.462 ms
root@TOPST:~#
root@TOPST:~# sudo docker run --rm --network bridge alpine ping -c 3 google.com
ping: bad address 'google.com'
root@TOPST:~#
Bridge network가 기본 네트워크 모드인 만큼, 중요한 기능이라고 생각되어 집니다. 혹시 관련하여 필요한 모듈을 포함하여 커널을 빌드하여 이미지를 배포해 줄 수 있을까요?