A way to suppress the warning (that the snippet in OP would've raised) is to put a check at the top of Dockerfile:
# syntax=docker/dockerfile:1 # check=skip=InvalidDefaultArgInFrom