$docker-compose build
mv: cannot stat '/root/.symfony/bin/symfony': No such file or directory
ERROR: Service 'www_symfony_colcot' failed to build: The command '/bin/sh -c echo "ServerName localhost" >> /etc/apache2/apache2.conf && apt-get
Normaly auto generated by docker-compose.yml
docker-compose.yml :
version: "3.5"
services:
db_symfony_colcot:
image: mariadb:10.5.13
container_name: db_symfony_colcot
command: [ "--default-authentication-plugin=mysql_native_password" ]
restart: always
environment:
MYSQL_ROOT_PASSWORD: gsbgenerique
MYSQL_DATABASE: colcot
MYSQL_USER: gestionnaire
MYSQL_PASSWORD: gsbgenerique
volumes:
- ./initSQL/:/docker-entrypoint-initdb.d/
- "./datamysql-colcot:/var/lib/mysql"
ports:
- "3311:3306"
networks:
- dev-sym
www_symfony_colcot:
build: php
container_name: www_symfony_colcot
ports:
- "8094:80"
user: 0:0
volumes:
- ./php/vhosts:/etc/apache2/sites-enabled
- /home/marc/Desktop/colcot/colcot-2022/Colcot/:/var/www
restart: always
networks:
- dev-sym
networks:
dev-sym:
volumes:
db-data:
Dockerfile :
FROM php:7.4-apache
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf \
\
&& apt-get update \
&& apt-get install -y --no-install-recommends \
locales apt-utils git libicu-dev g++ libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev unzip \
\
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen \
\
&& curl -sS https://getcomposer.org/installer | php -- \
&& mv composer.phar /usr/local/bin/composer \
\
&& curl -sS https://get.symfony.com/cli/installer | bash \
&& mv /root/.symfony/bin/symfony /usr/local/bin \
&& useradd -m symfony -u 1001 \
\
&& docker-php-ext-configure \
intl \
&& docker-php-ext-install \
pdo pdo_mysql opcache intl zip calendar dom mbstring gd xsl \
\
&& pecl install apcu && docker-php-ext-enable apcu
WORKDIR /var/www/
Error caused by line :
&& mv /root/.symfony/bin/symfony /usr/local/bin \
How can i solve this error please. Btw im beginner with docker but this project was working since 5 month ago.
Already try :
- Change mariadb version
- All php version ( from 5.6 to 8 )
- Change dockercompose version
Result : Still not working and same error