Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Build process returned exit code 137 during Docker build on Tutum

Tags:

docker

tutum

I've set a new repository on Tutum linked to a Github repository. This project built successfully on my local machine but it fail on Tutum after 4 hours and give me the following logs.

Step 27 : ENTRYPOINT /www/run.sh
---> Running in 666e1e87a660
---> eeb9646f9317
Removing intermediate container 666e1e87a660
Successfully built eeb9646f9317
Creating builder1769_sut_1
[Thu Jan 07 17:42:45.675789 2016] [mpm_prefork:notice] [pid 8] AH00163: Apache/2.4.10 (Debian) PHP/5.5.30 configured -- resuming normal operations
[Thu Jan 07 17:42:45.675813 2016] [core:notice] [pid 8] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
ERROR: Build process returned exit code 137
builder-1769: Terminating...
builder-1769: Terminated
ERROR: Build in 'dockerize' (bcf1bce8) failed in 4:00:52

The final step 27 of my Dockerfile has been reached and Docker return the message "Successfully built eeb9646f9317" but also "ERROR: Build process returned exit code 137" just after.

Here is my Dockerfile

FROM php:5.5-apache

#Add Servername to avoid warning
RUN sed -i '/ServerName localhost/ d' /etc/apache2/apache2.conf && sed -i '/Listen 80/ a\ServerName localhost' /etc/apache2/apache2.conf

#Add apt packages list for Firefox
RUN echo "deb http://packages.linuxmint.com debian import" >> /etc/apt/sources.list

RUN apt-get update \
    && apt-get install -q -y --force-yes libpng-dev php5-imagick php5-curl php5-mysql php5-ssh2 vim wkhtmltopdf curl nodejs npm nodejs-legacy ruby-full default-jre firefox xvfb  \
    git zlib1g-dev libicu-dev g++ libmcrypt-dev libxml2-dev \
    && rm -rf /var/lib/apt/lists/*

RUN curl -sSL https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer \
    && docker-php-ext-configure intl \
    && docker-php-ext-install gd zip pdo_mysql soap mbstring intl mcrypt bcmath \
    && a2enmod expires headers rewrite \
    && pecl install apcu-4.0.10 \
    && php5enmod mcrypt pdo_mysql \
    && echo "date.timezone=Europe/Paris" >> /usr/local/etc/php/php.ini \
    && echo "short_open_tag=Off" >> /usr/local/etc/php/php.ini \
    && echo "memory_limit=-1" >> /usr/local/etc/php/php.ini \
    && echo "upload_max_filesize=6M" >> /usr/local/etc/php/php.ini \
    && echo "extension=apcu.so" >> /usr/local/etc/php/php.ini

#Firefox
ENV FIREFOX_MINOR 34.0.5
RUN [ -e /usr/bin/firefox ] && rm /usr/bin/firefox
ADD https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FIREFOX_MINOR}/linux-x86_64/en-US/firefox-${FIREFOX_MINOR}.tar.bz2 /tmp/
RUN apt-get install -q -y libdbus-glib-1-2
RUN tar -xvjf /tmp/firefox-${FIREFOX_MINOR}.tar.bz2 -C /opt/
RUN chmod -R +x /opt/firefox/
RUN ln -s /opt/firefox/firefox /usr/bin/firefox

ADD .docker/vhost.conf /etc/apache2/sites-available/wweeddoo.conf
RUN a2ensite wweeddoo.conf
RUN sed -i '/DocumentRoot \/var\/www\/html/ d' /etc/apache2/apache2.conf
RUN sed -i 's/var\/www/www/g' /etc/apache2/apache2.conf

ADD . /www
WORKDIR /www

# Install dependencies
RUN mkdir -p app/sessions var/cache var/logs
RUN chown -R www-data app/sessions var/cache var/logs
RUN npm install -g bower
RUN npm install -g less
RUN gem install sass
RUN composer config -g github-oauth.github.com ff040c19e1b0ae0a4b97c0a140272ec89c8da161
RUN composer install --optimize-autoloader --prefer-dist

# Add run script
ADD .docker/run.sh /www/run.sh
RUN chmod +x /www/run.sh

ENTRYPOINT ["/www/run.sh"]

And my run.sh

chown -R www-data var/cache var/logs app/sessions
/usr/sbin/apache2ctl -D FOREGROUND

Any idea ?

like image 731
gregoirehumeau Avatar asked Jan 08 '16 10:01

gregoirehumeau


People also ask

How do I resolve exit code 137?

Reducing the number of executor cores reduces the maximum number of tasks that the executor processes simultaneously. Doing this reduces the amount of memory that the container uses. For a single job: Use the --executor-cores option to reduce the number of executor cores when you run spark-submit.

What causes a container to exit with code 137?

Exit code 137 is triggered when a pod or a container within your Kubernetes environment exceeds the amount of memory that they're assigned. Typically, this exit code is accompanied by or simply known as OOMKilled. Killed in this description refers to the result of this error, which causes a pod to terminate.

Did not complete successfully exit code 137?

What is OOMKilled (exit code 137) The OOMKilled error, also indicated by exit code 137, means that a container or pod was terminated because they used more memory than allowed. OOM stands for “Out Of Memory”. Kubernetes allows pods to limit the resources their containers are allowed to utilize on the host machine.


1 Answers

In Mac, to tackle with it, you might want to try changing memory allocation in Docker > Preference > Memory. Mostly increase will work.

like image 65
lakhani69 Avatar answered Sep 29 '22 15:09

lakhani69