Resizefs script on mender-convert images (specifically Raspberry Pi 3B)

I’m having an issue with mender-convert. I am creating images for the Raspberry Pi 3B using the following command:

sudo ./docker-mender-convert from-raw-disk-image --raw-disk-image $RAW_DISK_IMAGE --mender-disk-image $MENDER_DISK_IMAGE --device-type $DEVICE_TYPE --artifact-name $ARTIFACT_NAME --bootloader-toolchain arm-buildroot-linux-gnueabihf --server-url “” --tenant-token $TENANT_TOKEN --storage-total-size-mb 12000

As per the above command I am specifying an image size of 12000 mb.

My issues is that when i burn the resulting images to an SD card and then boot the SD card on a Raspberry Pi board the /data filesystem has not been expanded to fill the unused space on the SD card. In my case I’m using 16G SD cards so that the data filesystem should expand to be about 2.8G.

I’ve written up my results here:

Any pointers would be much appreciated. I’m not up to speed on partitions and file systems and so I suspect I’m missing something crucial in my tool chain.