Skip to content

The rootfs image can't be used as base image #191

@mikma

Description

@mikma

The Rootfs image can't be used as base image since any attempt to RUN commands fails with:

0.323 runc run failed: unable to start container process: error during container init: error mounting "/var/lib/docker/buildkit/executor/resolv.conf" to rootfs at "/etc/resolv.conf": create mountpoint for /etc/resolv.conf mount: make mountpoint "/etc/resolv.conf": file exists

Test case:

$ cat Dockerfile

FROM openwrt/rootfs

RUN mkdir /root/test

CMD [ "/sbin/init" ]

Test run:

$ docker build .

 > [2/2] RUN mkdir /root/test:                                                                                                                                                                
0.135 runc run failed: unable to start container process: error during container init: error mounting "/var/lib/docker/buildkit/executor/resolv.conf" to rootfs at "/etc/resolv.conf": create mountpoint for /etc/resolv.conf mount: make mountpoint "/etc/resolv.conf": file exists
------
Dockerfile:3
--------------------
   1 |     FROM openwrt/rootfs
   2 |     
   3 | >>> RUN mkdir /root/test
   4 |     
   5 |     CMD [ "/sbin/init" ]
--------------------
ERROR: failed to solve: process "/bin/sh -c mkdir /root/test" did not complete successfully: exit code: 1

Proposed solution: Don't include /etc/resolv.conf in the rootfs image. The file seems unnecessary since Docker mounts it's own version of the file anyway.

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