DemocraciaEnRed / participes-app

Plataforma digital que permite la publicacion de metas y compromisos de gobierno facilitando el seguimiento ciudadano
https://democraciaos.org/es/seguimientometas
GNU General Public License v3.0
5 stars 3 forks source link

Problemas al generar el docker de sumen #65

Closed InfraGllen closed 2 months ago

InfraGllen commented 2 months ago

✏️ Completá los campos que consideres necesarios. Borrá lo demás.

Pasos para reproducir

Se hizo un clon del proyecto participes-app y al hacer un docker compose aparecen los sigueintes errores:

Capturas de pantalla

[root@VMDockers participes-app]# docker build .
[+] Building 21.2s (16/17)                                                                                                                                                                                                    docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 1.44kB                                                                                                                                                                                                  0.0s
 => [internal] load metadata for [docker.io/library/php:7.2-fpm](http://docker.io/library/php:7.2-fpm)                                                                                                                                                                          3.4s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 264B                                                                                                                                                                                                       0.0s
 => [internal] load build context                                                                                                                                                                                                       0.0s
 => => transferring context: 87.77kB                                                                                                                                                                                                    0.0s
 => [ 1/13] FROM [docker.io/library/php:7.2-fpm@sha256:9c84ae47fddb97b94d1d2e289635b7306142a5336bc4ece0a393458c5e0d2cef](http://docker.io/library/php:7.2-fpm@sha256:9c84ae47fddb97b94d1d2e289635b7306142a5336bc4ece0a393458c5e0d2cef)                                                                                                                  0.0s
 => CACHED [ 2/13] RUN groupadd -g 101 www && useradd -u 101 -ms /bin/bash -g www www                                                                                                                                                   0.0s
 => CACHED [ 3/13] WORKDIR /var/www/html                                                                                                                                                                                                0.0s
 => CACHED [ 4/13] RUN apt-get update && apt-get install -y --no-install-recommends     build-essential     libpng-dev     libjpeg62-turbo-dev     libfreetype6-dev     locales     zip     jpegoptim optipng pngquant gifsicle     vi  0.0s
 => CACHED [ 5/13] RUN apt-get clean && rm -rf /var/lib/apt/lists/*                                                                                                                                                                     0.0s
 => CACHED [ 6/13] RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl                                                                                                                                                         0.0s
 => CACHED [ 7/13] RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/                                                                               0.0s
 => CACHED [ 8/13] RUN docker-php-ext-install gd                                                                                                                                                                                        0.0s
 => CACHED [ 9/13] RUN pecl install -o -f redis imagick && rm -rf /tmp/pear && docker-php-ext-enable redis imagick                                                                                                                      0.0s
 => [10/13] COPY --chown=www:www . .                                                                                                                                                                                                    0.2s
 => [11/13] RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer                                                                                                                    4.7s
 => ERROR [12/13] RUN composer install && chown -R www:www .                                                                                                                                                                           12.8s
------                                                                                                                                                                                                                                      
 > [12/13] RUN composer install && chown -R www:www .:                                                                                                                                                                                      
0.377 No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.                                                                        
0.378 Loading composer repositories with package information                                                                                                                                                                                
12.46 Updating dependencies                                                                                                                                                                                                                  
12.67 Your requirements could not be resolved to an installable set of packages.                                                                                                                                                            
12.67
12.67   Problem 1
12.67     - Root composer.json requires php ^7.3|^8.0 but your php version (7.2.34) does not satisfy that requirement.
12.67   Problem 2
12.67     - laravel/framework[v8.12.0, ..., 8.x-dev] require php ^7.3|^8.0 -> your php version (7.2.34) does not satisfy that requirement.
12.67     - laravel/framework[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (7.2.34) does not satisfy that requirement.
12.67     - Root composer.json requires laravel/framework ^8.0 -> satisfiable by laravel/framework[v8.0.0, ..., 8.x-dev].
12.67
------
WARNING: current commit information was not captured by the build: failed to read current commit information with git rev-parse --is-inside-work-tree
Dockerfile:37
--------------------
  35 |     COPY --chown=www:www . .
  36 |     RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
  37 | >>> RUN composer install && chown -R www:www .
  38 |    
  39 |     # Setup entrypoint (including development script)
--------------------
ERROR: failed to solve: process "/bin/sh -c composer install && chown -R www:www ." did not complete successfully: exit code: 2
[root@VMDockers participes-app]#
mpvaldez commented 2 months ago

Gracias por el aviso! Parece ser un problema de dependencias. Vamos a darle una revisada a las librerías y un poco al composer. Te avisamos si encontramos algo.

Si llegas a dar con la solución, porfa compartila.

mpvaldez commented 2 months ago

@InfraGllen, Solucionado! Cambié la versión de php de 7.2-fpm a 7.4-fpm. Esto llevó a tener que agregar otras dependencias. Funcionó.

Fijate porfa si podes dar el setup ahora. Una vez que puedas levantarlo deberias ingresar a localhost:8000.

InfraGllen commented 2 months ago

Hice lo que me pidieron, de cambiar la versión del php, ahora cambia el error y me dice que no puede actualizar uno de los paquetes... a continuación va la cola del log. Esto sucede al ejecutar lo sig. => ERROR [ 6/13] RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl Aguardo comentarios.

10.62 checking whether to enable multibyte regex support (requires oniguruma)... yes 10.63 checking for oniguruma... no 10.64 configure: error: Package requirements (oniguruma) were not met: 10.64 10.64 No package 'oniguruma' found 10.64 10.64 Consider adjusting the PKG_CONFIG_PATH environment variable if you 10.64 installed software in a non-standard prefix. 10.64 10.64 Alternatively, you may set the environment variables ONIG_CFLAGS 10.64 and ONIG_LIBS to avoid the need to call pkg-config. 10.64 See the pkg-config man page for more details.

Dockerfile:29

27 |
28 | # Install extensions 29 | >>> RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl 30 | RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ 31 | RUN docker-php-ext-install gd

ERROR: failed to solve: process "/bin/sh -c docker-php-ext-install pdo_mysql mbstring zip exif pcntl" did not complete successfully: exit code: 1

mpvaldez commented 2 months ago

Perdón me olvidé de aclarar. Hay que hacer un git pull para obtener los cambios que hice.

InfraGllen commented 1 month ago

Tengo un problema al ejecutar el docker, es como que algo le falta a la bbdd y no levanta. Adjunto archivo con los logs del docker compose up para ver si me puden dar una solución. Desde ya agradecido. sumenGllen.log