@shevchenko__k
Помогаю новорожденным web программистам

Почему не запускается Docker?

Пытаюсь первый раз развернуть рабочее окружение на  docker. Помогите пожалуйста.

При команде в консоле docker-compose up выводит такой результат с ошибками
docker-compose up
Building php
[WARNING]: Empty continuation line found in:
RUN apt-get update && apt-get install -y curl wget git libfreetype6-dev libjpeg62-turbo-dev libxslt-dev libicu-dev libmcrypt-dev libpng12-dev libxml2-dev && docker-php-ext-install -j$(nproc) iconv mcrypt mbstring pdo_pgsql zip && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
[WARNING]: Empty continuation lines will become errors in a future release.
Step 1/10 : FROM php:7.0-fpm
7.0-fpm: Pulling from library/php
177e7ef0df69: Pull complete
9bf89f2eda24: Pull complete
350207dcf1b7: Pull complete
a8a33d96b4e7: Pull complete
8069cdba34b5: Pull complete
25ae788babab: Pull complete
1df95586682b: Pull complete
4c66f054f322: Pull complete
b7221dc910cf: Pull complete
71b3dbdbc6f4: Pull complete
Digest: sha256:8e8644c0fd61424939fff072ca617469550bbb659158301a2dcadf334746a1c2
Status: Downloaded newer image for php:7.0-fpm
---> 29e9a8718c7b
Step 2/10 : RUN apt-get update && apt-get install -y curl wget git libfreetype6-dev libjpeg62-turbo-dev libxslt-dev libicu-dev libmcrypt-dev libpng12-dev libxml2-dev && docker-php-ext-install -j$(nproc) iconv mcrypt mbstring pdo_pgsql zip && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
---> Running in f2350231ef18
Get:1 security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 deb.debian.org/debian stretch InRelease
Get:3 deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 security.debian.org/debian-security stretch/updates/main amd64 Packages [527 kB]
Get:5 deb.debian.org/debian stretch Release [118 kB]
Get:6 deb.debian.org/debian stretch Release.gpg [2410 B]
Get:7 deb.debian.org/debian stretch-updates/main amd64 Packages [27.9 kB]
Get:8 deb.debian.org/debian stretch/main amd64 Packages [7083 kB]
Fetched 7944 kB in 4s (1960 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package libpng12-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libpng12-dev' has no installation candidate
ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y curl wget git libfreetype6-dev libjpeg62-turbo-dev libxslt-dev libicu-dev libmcrypt-dev libpng12-dev libxml2-dev && docker-php-ext-install -j$(nproc) iconv mcrypt mbstring pdo_pgsql zip && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd' returned a non-zero code: 100


docker-compose
version: '2.2'

services:

db:
image: postgres
restart: always
environment:
POSTGRES_DB: startup_db
POSTGRES_USER: startuper
POSTGRES_PASSWORD: test123
web:
image: nginx
volumes:
- ./startup.conf:/etc/nginx/conf.d/startup.loc
ports:
- "8080:80"
environment:
- NGINX_HOST=startup.loc
- NGINX_PORT=80
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
php:
# Билдим с помощью dockerfile указав директорию где он лежит
build: ./PHP

container_name: php-fpm

volumes:
- ./web/startup.loc:/var/www/startup.loc

links:
- db


Dockerfile
FROM php:7.0-fpm

RUN apt-get update && apt-get install -y \
curl \
wget \
git \
libfreetype6-dev \
libjpeg62-turbo-dev \
libxslt-dev \
libicu-dev \
libmcrypt-dev \
libpng12-dev \
libxml2-dev \

&& docker-php-ext-install -j$(nproc) iconv mcrypt mbstring pdo_pgsql zip \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd

RUN docker-php-ext-configure intl
RUN docker-php-ext-install intl
RUN docker-php-ext-install xsl
RUN docker-php-ext-install soap

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

ADD php.ini /usr/local/etc/php/conf.d/40-custom.ini

WORKDIR /var/www/startup.loc

CMD ["php-fpm"]


startup.conf
server {
index index.php;
server_name startuo.loc;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/startuo.loc/public;

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
  • Вопрос задан
  • 238 просмотров
Пригласить эксперта
Ответы на вопрос 1
Stam_emg
@Stam_emg
Системный администратор, Atlassian Stack
E: Package 'libpng12-dev' has no installation candidate - нету пакета в репозиториях, которые подключены.

отсюда следует ERROR: Service 'php' failed to build: потому что не установлена. в debian stretch пакет называется libpng-dev .
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы