containerd / containerd/nerdctl

Unable to run container with bridge network in Alpine Linux ("iptables v1.8.10 (nf_tables): table `nat' is incompatible, use 'nft' tool.")

Open
#3,788 7 comments 0 reactions 0 assignees View on GitHub
area/network kind/external
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### Description

I believe this bug has existed since Alpine Linux switched to using nft as the default iptables backend starting with version 3.19.0. Currently, this bug affects Alpine versions 3.19.x, 3.20.x, and 3.21.x.

### Steps to reproduce the issue

1. Install nerdctl from the Alpine package manager: `apk add nerdctl`.
2. Start containerd service: `rc-service containerd start`.
3. Run a container and publish a port: `nerdctl run --rm -it -p 3000:3000 alpine`

### Describe the results you received and expected

Got an error:

```
FATA[0001] failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running createRuntime hook #0: exit status 1, stdout: , stderr: time="2024-12-23T16:58:56+08:00" level=fatal msg="failed to call cni.Setup: plugin type=\"bridge\" failed (add): failed to list chains: running [/usr/sbin/iptables -t nat -S --wait]: exit status 1: iptables v1.8.10 (nf_tables): table `nat' is incompatible, use 'nft' tool.\n"
```

No errors when I use the host network: `nerdctl run --rm --network host -it alpine`

### What version of nerdctl are you using?

WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
Client:
Version:
OS/Arch: linux/arm64
Git commit:
buildctl:
Version:

Server:
containerd:
Version: v2.0.0
GitCommit: 207ad711eabd375a01713109a8a197d197ff6542
runc:
Version: 1.2.2
GitCommit: 7cb363254b69e10320360b63fb73e0ffb5da7bf2

### Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

### Host information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.