Skip to content

Impossible to run container with macvlan network due to invalid dnsSwitch config #834

@domysh

Description

@domysh

I'm using sysbox to simulate some VMs, but I can't start this container with sysbox using this configuration (This is only a small part of the configuration, for test the bug)

services:
    team0:
        build: .
        runtime: sysbox-runc
        networks:
            vm-team0:
                ipv4_address: 10.60.0.1
networks:
    vm-team0:
        internal: true
        driver: macvlan
        ipam:
            driver: default
            config:
                - subnet: 10.60.0.0/24
                  gateway: 10.60.0.254

and this Dockerfile

FROM cruizba/ubuntu-dind:latest

RUN apt-get update

RUN apt-get install -y \
	iproute2 vim nano tcpdump iputils-ping \
	python3-pip python3-venv screen netcat-openbsd btop htop neovim \
	nano curl git wget unzip zip traceroute net-tools 

# SSH
RUN apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
EXPOSE 22

CMD ["/usr/bin/tail", "-f", "/dev/null"]

I'm running sysbox on arm, when I try to start the container I got this error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: container_linux.go:439: starting container process caused: process_linux.go:608: container init caused: process_linux.go:579: handleReqOp caused: rootfs_init_linux.go:427: Docker DNS switch from 127.0.0.11 to  caused: failed to start [/usr/sbin/iptables-restore --wait 30 --wait-interval 100000]: exit status 2: unknown

Reading the source code and this error I think that the problem is that sysbox recieve an empty newDns and a wrong iptables configuration is generated and for this iptables-restore crashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions