8000 Fix docker build with zlib errors by jessedobbelaere · Pull Request #3121 · forkcms/forkcms · GitHub
[go: up one dir, main page]

Skip to content

Fix docker build with zlib errors#3121

Merged
carakas merged 11 commits intoforkcms:masterfrom
jessedobbelaere:fix-docker-build-zlib
Jun 8, 2020
Merged

Fix docker build with zlib errors#3121
carakas merged 11 commits intoforkcms:masterfrom
jessedobbelaere:fix-docker-build-zlib

Conversation

@jessedobbelaere
Copy link
Member

Type

  • Non critical bugfix

Resolves the following issues

Pull request description

During docker-compose up -d or docker-compose build or docker build ... the Dockerfile would crash with following error:

Building app
Step 1/20 : FROM php:7.1-apache
 ---> b9858ffdd4d2
Step 2/20 : LABEL maintainer="Fork CMS <info@fork-cms.com>"
 ---> Using cache
 ---> f41fa1d2c4e9
Step 3/20 : RUN a2enmod rewrite
 ---> Using cache
 ---> 7e1396dc317b
Step 4/20 : RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
 ---> Using cache
 ---> 8be3ed855971
Step 5/20 : RUN apt-get update && apt-get install -y --no-install-recommends --allow-downgrades     libfreetype6-dev     libjpeg62-turbo-dev     libz-dev     zlib1g=1:1.2.8.dfsg-2+b1     libpng-dev &&     docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&     docker-php-ext-install -j$(nproc) gd &&     rm -rf /var/lib/apt/lists/*
 ---> Running in 8985795c4a80
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign:2 http://archive.debian.org/debian jessie InRelease
Get:3 http://archive.debian.org/debian jessie Release [148 kB]
Get:4 http://archive.debian.org/debian jessie Release.gpg [2420 B]
Get:5 http://security.debian.org jessie/updates/main Sources [350 kB]
Get:6 http://security.debian.org jessie/updates/main amd64 Packages [771 kB]
Get:7 http://archive.debian.org/debian jessie/main Sources [7063 kB]
Get:8 http://archive.debian.org/debian jessie/main amd64 Packages [6818 kB]
Fetched 15.2 MB in 3s (5160 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-2+deb8u1) but 1:1.2.8.dfsg-2+b1 is to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends --allow-downgrades     libfreetype6-dev     libjpeg62-turbo-dev     libz-dev     zlib1g=1:1.2.8.dfsg-2+b1     libpng-dev &&     docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ &&     docker-php-ext-install -j$(nproc) gd &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

@jessedobbelaere
Copy link
Member Author

Seems the line

# Run apt from fresh debian sources
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list

is causing some conflicts with the GD dependencies all the times. Was there a specific reason you added it @StijnVrolijk ? Think #2891 was related too... If i leave out this line like in my PR it builds correctly... I think it causes some flakyness for reliable Docker builds

@jessedobbelaere jessedobbelaere marked this pull request as ready for review May 27, 2020 00:41
@jessedobbelaere jessedobbelaere requested a review from a team as a code owner May 27, 2020 00:41
@jessedobbelaere jessedobbelaere force-pushed the fix-docker-build-zlib branch from db465a7 to 2f0921f Compare May 27, 2020 00:56
@jessedobbelaere jessedobbelaere force-pushed the fix-docker-build-zlib branch from 2f0921f to d642656 Compare May 27, 2020 01:05
@jessedobbelaere jessedobbelaere marked this pull request as draft May 27, 2020 01:06
@jessedobbelaere jessedobbelaere marked this pull request as ready for review May 27, 2020 09:37
8000
@carakas carakas added this to the 5.8.3 milestone May 28, 2020
@jessedobbelaere
Copy link
Member Author
jessedobbelaere commented May 28, 2020

FYI I remember we introduced the .env file in Fork, and we moved the .env file of docker-compose to the docker folder. But I see these errors:

❯ docker-compose build
WARNING: The PHP_IDE_CONFIG variable is not set. Defaulting to a blank string.
WARNING: The XDEBUG_IDEKEY variable is not set. Defaulting to a blank string.
WARNING: The XDEBUG_PORT variable is not set. Defaulting to a blank string.
WARNING: The DOCKER_HOST_IP variable is not set. Defaulting to a blank string.

and with a printenv inside the container I could see that they are not set. I cleaned up the docker-compose file again which should make it work again now 👍

@carakas carakas merged commit 047842d into forkcms:master Jun 8, 2020
@jessedobbelaere jessedobbelaere deleted the fix-docker-build-zlib branch July 19, 2020 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0