mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-13 05:39:23 +00:00
Remount rootfs as read-only after init, /var and /containers mounted as
read-write Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
@@ -105,4 +105,13 @@ ip link set lo up
|
||||
# for containerising dhcpcd and other containers that need writable etc
|
||||
mkdir /tmp/etc
|
||||
mv /etc/resolv.conf /tmp/etc/resolv.conf
|
||||
ln -snf /tmp/etc/resolv.conf /etc/resolv.conf
|
||||
ln -snf /tmp/etc/resolv.conf /etc/resolv.conf
|
||||
|
||||
# remount rootfs as readonly
|
||||
mount -o remount,ro /
|
||||
|
||||
# bind and remount containers and var as read-write
|
||||
mount -o bind /containers /containers
|
||||
mount -o bind /var /var
|
||||
mount -o remount,rw,relatime /containers /containers
|
||||
mount -o remount,rw,nodev,nosuid,relatime /var /var
|
||||
|
Reference in New Issue
Block a user