I need help with Moodle's permissions

This Moodle DockerFile gives me the following error (I’m running it with a Docker-compose that has the mysql5.7 default image):

"Data directory (/var/www/moodledata) cannot be created by the installer."
It’s a permissions error but i dnt know why am I gettin’ it or what can I do to solve it.

Dockerfile:

FROM ubuntu:16.04

MAINTAINER Carles Fitó “carles_fitonegre@iescarlesvallbona.cat”

EXPOSE 80

RUN apt update && apt install -y
apache2
apache2-doc \
nano
php7.0-zip
php7.0-mysql
php7.0-curl
php7.0-json
php7.0-cgi
php7.0
libapache2-mod-php7.0
php7.0-mcrypt

COPY moodle.conf /etc/apache2/sites-available/moodle.conf
COPY downloads.conf /etc/apache2/sites-available/downloads.conf

RUN mkdir /var/www/downloads

RUN chown www-data var/www/downloads/
RUN echo “Downloads” > /var/www/downloads/index.html

COPY /moodle /var/www/moodle

RUN chown www-data -R /var/www/moodle/
RUN chown -R 775 /var/www/moodle/

RUN chown www-data -R /var/www
RUN chmod 770 -R /var/www

RUN mkdir /var/www/moodledata
RUN chown www-data -R /var/www/moodledata
RUN chmod 770 -R /var/www/moodledata

RUN a2ensite moodle.conf
RUN a2ensite downloads.conf

RUN service apache2 restart

VOLUME ["/var/www/moodledata","/var/log/apache2","/etc/php7/apache2/"]

CMD ["/usr/sbin/apache2ctl", “-D”, “FOREGROUND”]

I just had the same thing. It said that the parent directory (/var/www/) has to be writable:
chmod 777 /var/www