Building a docker image fail at a step running webpack to build the client application (React).
Any tips why this happens?
Bitbucket says: Container 'docker' exceeded memory limit.

Dockerfile:
# Use an official Node runtime as a parent image
FROM node:8-alpine
# Install any needed tools
RUN apk add --no-cache --update curl ca-certificates openssl git && \
update-ca-certificates && \
addgroup -S app && \
adduser -S -g app app && \
mkdir -p /usr/src/app
# Prepare build
WORKDIR /usr/tmp
COPY . /usr/tmp
# CONSUMER KEY & SECRET must be set by environment
ENV CONSUMER_KEY=CONSUMER_KEY__
ENV CONSUMER_SECRET=CONSUMER_SECRET__
# Install deps and build the client
RUN ["npm", "install", "--no-save"]
RUN ["npm", "run", "build:client"]
# Set working directory for image
WORKDIR /usr/src/app
# Copy needed files for runtime
COPY /usr/tmp/node_modules /usr/src/app/node_modules
COPY /usr/tmp/build /usr/src/app/client
COPY ./server/ /usr/src/app/server
COPY ./package.json /usr/src/app
COPY Docker-cmd.sh /
# Set Docker-cmd executable
RUN chmod a+x /Docker-cmd.sh
# Clean up
RUN rm -fr /usr/tmp
# Set client application port
ENV PORT=80
# Make port 80 available to outside this container
EXPOSE ${PORT}
# Run /Docker-cmd.sh when the container launches
CMD [ "/Docker-cmd.sh" ]
bitbucket-pipeline.yml:
pipelines:
default:
- step:
name: Build Docker image
script:
- docker build -t test .
services:
- docker
caches:
- docker