Docker Community Forums

Share and learn in the Docker community.

Build Dockerfile failed


(Marwenb) #1

Hello every one,
I’m using a Dockerfile to build my own image,

This the Dockerfile looks like,

FROM php:5.6-apache
MAINTAINER name <email>
LABEL version="1.0"
LABEL description="Apache 2 / PHP"
RUN apt-get update -y \
   && apt-get install -y  software-properties-common \
   && apt-get install -y python-software-properties \
   && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y \
   && apt-get install -y \
    libmcrypt-dev \
    git \
    zip unzip \
    libicu-dev \
    zlib1g-dev \
    php5 \
    php5-fpm \
    php5-dev \
    php5-common \
    php5-json \
    php5-memcache \
    php5-memcached  \
    php5-xsl \
    php5-mcrypt \
    php5-mysql \
    php5-cli \
    php5-gd \
    php5-intl \
    php5-curl \
  && docker-php-ext-install -j$(nproc) pdo_mysql mysql mysqli iconv mcrypt opcache
RUN curl -sS | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer config --global process-timeout 2000
RUN a2enmod rewrite
ADD php-custom.ini /etc/php5/apache2/conf.d
ADD php-custom.ini /etc/php5/cli/conf.d
ADD php-custom.ini /usr/local/etc/php/conf.d
RUN rm /etc/localtime
RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN "date"
RUN usermod -u 1000 www-data
# Define mountable directories.
VOLUME ["/var/www/html"]

This is the result:

gpg: keyring /tmp/tmpf8uqhltk/secring.gpg' created gpg: keyring/tmp/tmpf8uqhltk/pubring.gpg’ created
gpg: requesting key E5267A6C from hkp server
gpg: /tmp/tmpf8uqhltk/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key “Launchpad PPA for Ondřej Surý” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

Hit jessie/updates InRelease
Err jessie/main amd64 Packages
Err jessie/main amd64 Packages
Ign jessie InRelease
Err jessie/main amd64 Packages
Err jessie/main amd64 Packages
404 Not Found

W: Failed to fetch 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

what i can do for That ?
Thank you.

(David Maze) #2

Contact the owner of that Ubuntu Personal Package Archive and ask if they can fix it, or maybe use an Ubuntu rather than a Debian base. This doesn’t especially sound like a Docker-specific problem.

(It does look weird to me that you’re starting from a prepackaged PHP image, then installing PHP in it. It looks especially weird to me to install git in your image: you’d never run git as part of your running application, and Docker layer caching makes running git clone in a Dockerfile not actually do what you expect.)