Preface
Two methods for provisioning containers.
Single Container Provisioning
- Creates a single Podman container
- Can configure a routed public IPv6 address after
podman-ipv6is configured during installation - Supports x86_64 and ARM64 architecture servers
IPv6 network mode
podman-ipv6 uses a managed ULA bridge. A separate public address is attached as a routed /128 with NDP, rather than cutting a child subnet from the host's public /64 for Netavark IPAM. The host needs usable public IPv6 and the upstream must permit the corresponding NDP neighbor response.
Download Script
curl -sSLO https://raw.githubusercontent.com/oneclickvirt/podman/main/scripts/onepodman.sh
chmod +x onepodman.sh2
Example
Supported variables for running:
./onepodman.sh <name> <cpu> <memory_mb> <password> <sshport> <startport> <endport> [independent_ipv6:y/n] [system] [disk_gb]Currently supported system values:
- debian
- ubuntu
- alpine
- almalinux
- rockylinux
- openeuler
Default is debian if not specified.
./onepodman.sh ct1 1 512 MyPassword 25000 34975 35000 n debian 0Example container information:
| Attribute | Value |
|---|---|
| Container name | ct1 |
| SSH username | root |
| SSH password | MyPassword |
| CPU cores | 1 |
| Memory | 512MB |
| SSH port | 25000 |
| External/internal port range | 34975 to 35000 |
| System | debian |
| Request routed public IPv6 | N |
| Disk size | Unlimited |
Related Operations
List all containers
podman ps -aEnter container
podman exec -it ct1 bashEnter Alpine container
podman exec -it ct1 shType exit to leave the container.
Delete container
podman rm -f ct1View container logs
podman logs ct1Batch Container Provisioning
- Multiple runs inherit configuration and generate sequentially
- Auto-increments container name (ct1, ct2, ...), SSH port, and public ports
- Container information recorded to
ctlogfile - Recommended to run in screen to avoid SSH disconnection
Run
curl -sSLO https://raw.githubusercontent.com/oneclickvirt/podman/main/scripts/create_podman.sh
chmod +x create_podman.sh
./create_podman.sh2
3
Query Batch Container Information
cat ctlogOutput format:
container_name ssh_port root_password cpu_cores memory_mb start_port end_port disk_gbOne line per container.
Remove All Containers and Images
podman ps -aq | xargs -r podman rm -f
podman images -aq | xargs -r podman rmi -f
podman volume prune -f
podman system prune -af
rm -rf ctlog2
3
4
5
Restart All Containers After Host Reboot
Podman supports systemd integration. Generate auto-start service for a container:
# Generate systemd service for a specific container
podman generate systemd --name ct1 > /etc/systemd/system/container-ct1.service
systemctl enable container-ct12
3
Or manually start all stopped containers:
podman ps -aq -f status=exited | xargs -r podman start