Public Repository

Last pushed: a year ago
Short Description
Quickly resize a filesystem and/or partition
Full Description

A quick one-off ubuntu based image - will be replaced with one of my gentoo-based busybox images soon.

[rancher@rancher ~]$ cat Dockerfile.resize2fs
FROM ubuntu
RUN apt-get update
RUN apt-get install -y cloud-guest-utils parted udev

COPY resize-fs.sh /entry.sh

ENTRYPOINT ["/entry.sh"]
[rancher@rancher ~]$ cat resize-fs.sh

#!/bin/bash
RESIZE_DEV="$1"
test -b /dev/${RESIZE_DEV} || export RESIZE_DEV=""
if [ "X${RESIZE_DEV}" = "X" ] ; then
echo "Must set RESIZE_DEV=[/dev/a_valid_block_device]"
exit 1
elif [ "${RESIZE_DEV}" = "xvda1" ] ; then
resize2fs /dev/${RESIZE_DEV}
else
growpart /dev/${RESIZE_DEV} 1
partprobe
resize2fs /dev/${RESIZE_DEV}
fi

Docker Pull Command
Owner
guruvan

Comments (0)