How to change ownership of folder inside the container after build?
you need to create the www-data user in the dockerfile eg
RUN addgroup -g 1000 www-data &amp;&amp; adduser -G www-data -g www-data -s /bin/sh -D www-data

RUN chown -R www-data:www-data /home/www-data &amp;&amp; \
    chown -R www-data:www-data /var/www