I've been following [enter link description here][blog-post] by DigitalOcean on setting up laravel in docker within Laravel 18.04. When I run the command docker-compose up -d
I get the following error:
E: Failed to fetch http://deb.debian.org/debian/pool/main/libx/libx11/libx11-6_1.6.7-1_amd64.deb
Error reading from server - read (104: Connection reset by peer) [IP: 128.31.0.62 80]E: Failed to fetch http://deb.debian.org/debian/pool/main/j/javascript-common/javascript-common_11_all.deb Error reading from server - read (104: Connection reset by peer) [IP: 128.31.0.62 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/f/freetype/libfreetype6_2.9.1-3_amd64.deb Error reading from server - read (104: Connection reset by peer) [IP: 128.31.0.62 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y build-essential mariadb-client
libpng-dev libjpeg62-turbo-dev libfreetype6-dev locales
zip jpegoptim optipng pngquant gifsicle vim unzip git curl' returned a non-zero code: 100
I've replaced myysql-client
with mariadb-client
following the post from stack overflow as it was causing error of another kind.
It would be very helpful if anyone could guide me through this as I'm new to Docker.
FROM php:7.3-fpm
# Copy composer.lock and composer.json
COPY composer.lock composer.json /var/www/
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
mariadb-client \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install extensions
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy existing application directory contents
COPY . /var/www
# Copy existing application directory permissions
COPY --chown=www:www . /var/www
# Change current user to www
USER www
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]