On my Ubuntu machine, the line
RUN tar xvzf /wordpress.tar.gz -C /usr/share/nginx
fails with exit code 2.
On closer inspection, /wordpress.tar.gz is a directory. It seems like
ADD http://wordpress.org/latest.tar.gz /wordpress.tar.gz
has already unzipped it when it downloaded the file.
It would be good to put in check for this to skip the tar step if necessary. Just commenting out the tar command and changing the path for the ADD step fixes this on my machine.
To clarify, this works for me (but probably breaks for someone else!):
# Install Wordpress
ADD http://wordpress.org/latest.tar.gz /usr/share/nginx
RUN rm -rf /usr/share/nginx/www
RUN mv /usr/share/nginx/wordpress /usr/share/nginx/www
RUN chown -R www-data:www-data /usr/share/nginx/www
On my Ubuntu machine, the line
RUN tar xvzf /wordpress.tar.gz -C /usr/share/nginx
fails with exit code 2.On closer inspection,
/wordpress.tar.gz
is a directory. It seems likeADD http://wordpress.org/latest.tar.gz /wordpress.tar.gz
has already unzipped it when it downloaded the file.It would be good to put in check for this to skip the tar step if necessary. Just commenting out the tar command and changing the path for the ADD step fixes this on my machine.
To clarify, this works for me (but probably breaks for someone else!):