Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

eddy1992's avatar

Dockerize Laravel projects

Hi I am trying to setup docker on my new system and trying to make the Laravel projects work using docker. In such a case I am trying to build an image using the following Dockerfile which would install the Nginx and the php. I am using M1 apple silicon MacBook and I am facing some issues when I am trying to build it.

My Dockerfile

FROM ubuntu:16.04


RUN apt-get update \
    && apt-get install -y locales \
    && locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

RUN apt-get update \
    && apt-get install -y nginx curl zip unzip git software-properties-common supervisor \
    && add-apt-repository -y ppa:ondrej/php \
    && apt-get update \
    && apt-get install -y php7.0-fpm php7.0-cli php7.0-mcrypt php7.0-gd php7.0-mysql \
       php7.0-pgsql php7.0-imap php-memcached php7.0-mbstring php7.0-xml php7.0-curl \
       php7.0-sqlite3 php7.0-xdebug \
    && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
    && mkdir /run/php \
    && apt-get remove -y --purge software-properties-common \
    && apt-get -y autoremove \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
    && echo "daemon off;" >> /etc/nginx/nginx.conf

RUN ln -sf /dev/stdout /var/log/nginx/access.log \
    && ln -sf /dev/stderr /var/log/nginx/error.log

COPY default /etc/nginx/sites-available/default

COPY php-fpm.conf /etc/php/7.0/fpm/php-fpm.conf

EXPOSE 80

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

CMD ["/usr/bin/supervisord"]

I am getting the following error when I am trying to build it.

executor failed running [/bin/sh -c apt-get update     && apt-get install -y nginx curl zip unzip git software-properties-common supervisor     && add-apt-repository -y ppa:ondrej/php     && apt-get update     && apt-get install -y php7.0-fpm php7.0-cli php7.0-mcrypt php7.0-gd php7.0-mysql        php7.0-pgsql php7.0-imap php-memcached php7.0-mbstring php7.0-xml php7.0-curl        php7.0-sqlite3 php7.0-xdebug     && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && mkdir /run/php     && apt-get remove -y --purge software-properties-common     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*     && echo "daemon off;" >> /etc/nginx/nginx.conf]: exit code: 100

Is there any clue about how could I fix this issue?

Please assist. Thank you.

0 likes
0 replies

Please or to participate in this conversation.