mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-15 15:03:48 +00:00
Add persistent drive support to Docker container
This works and runs containers now, if you eg `runc exec` into it. Needs a few tweaks for rlimits, but will pull and run containers. Will integrate better with ssh/dev containers to make more usable. For a simple test use ``` ./bin/moby build examples/docker.yml ./bin/moby run hyperkit -disk-size 100 docker ``` Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -46,6 +46,7 @@ do_fsck_extend_mount()
|
||||
SPACE=$(sfdisk -F "$DRIVE" | grep 'Unpartitioned space')
|
||||
printf "Resizing disk partition: $SPACE\n"
|
||||
|
||||
# 83 is Linux partition id
|
||||
START=$(sfdisk -J "$DRIVE" | jq -e '.partitiontable.partitions | map(select(.type=="83")) | .[0].start')
|
||||
|
||||
sfdisk -q --delete "$DRIVE" 2> /dev/null
|
||||
@@ -84,7 +85,9 @@ do_mkfs()
|
||||
|
||||
# update status
|
||||
blockdev --rereadpt $diskdev 2> /dev/null
|
||||
mdev -s
|
||||
|
||||
# wait for device
|
||||
for i in $(seq 1 50); do test -b "$DATA" && break || sleep .1; mdev -s; done
|
||||
|
||||
FSOPTS="-O resize_inode,has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user