ui-avatars icon indicating copy to clipboard operation
ui-avatars copied to clipboard

Dockerfile fails to start

Open athamour1 opened this issue 2 years ago • 1 comments

Dockerfile crashes when it pulls the dependencies, maybe the packets are deprecated, I will try to find what's wrong. The log that I get is the following

error messages
❯ docker build .
Sending build context to Docker daemon  1.071MB
Step 1/11 : FROM kstaken/apache2
 ---> 2dde0ff8b71b
Step 2/11 : LABEL name "my-docker-deployment"
 ---> Using cache
 ---> ff0426b04dc4
Step 3/11 : RUN apt-get update && apt-get install -y php5 curl git zip libapache2-mod-php5 php5-mysql php5-cli && apt-get clean && rm -rf /var/lib/apt/lists/*
 ---> Running in 0666894d0f55
Ign http://archive.ubuntu.com precise InRelease
Ign http://archive.ubuntu.com precise Release.gpg
Ign http://archive.ubuntu.com precise Release
Ign http://archive.ubuntu.com precise/main TranslationIndex
Err http://archive.ubuntu.com precise/main amd64 Packages
  404  Not Found [IP: 185.125.190.39 80]
Err http://archive.ubuntu.com precise/main i386 Packages
  404  Not Found [IP: 185.125.190.39 80]
Ign http://archive.ubuntu.com precise/main Translation-en
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages  404  Not Found [IP: 185.125.190.39 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found [IP: 185.125.190.39 80]

E: Some index files failed to download. They have been ignored, or old ones used instead. The command '/bin/sh -c apt-get update && apt-get install -y php5 curl git zip libapache2-mod-php5 php5-mysql php5-cli && apt-get clean && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

athamour1 avatar Apr 15 '22 06:04 athamour1

Hi there.

I used the above Dockerfile. When I go for example to http://localhost/api/?background=0D8ABC&color=fff. It doesn't work. But using that URI in an img src field, it does work.

FROM php:7.3.10-apache

WORKDIR /var/www/html

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY Utils Utils
COPY api api
COPY assets assets
COPY index.html index.html
COPY composer.json composer.json
COPY composer.lock composer.lock

RUN mkdir -p cache && chmod 777 cache
RUN apt-get update -y  \
    && apt-get install -y \
        libpng-dev \
        libzip-dev \
        libfreetype6-dev \
        libjpeg-dev \
        libmcrypt-dev

RUN docker-php-ext-install iconv \
    && docker-php-ext-configure gd \
        --enable-gd-native-ttf \
        --with-freetype-dir=/usr/include/freetype2 \
        --with-png-dir=/usr/include \
        --with-jpeg-dir=/usr/include \
    && docker-php-ext-install gd \
    && docker-php-ext-enable gd
RUN docker-php-ext-install zip mbstring

RUN rm -rf vendor/ && composer install

EXPOSE 80
EXPOSE 44

This Dockerfile should be cleaner. I will do this tomorrow.

davidg251 avatar May 12 '22 01:05 davidg251