Reputation: 143
I have prepared a Dockerfile in order to use it for latest Symfony version. PHP 7.4 and Apache are my requirements. Dockerfile content as follows:
FROM php:7.4.0-apache-buster
# Set frontend. We'll clean this later on!
ENV DEBIAN_FRONTEND noninteractive
# Update
RUN apt-get -y update --fix-missing && \
apt-get upgrade -y && \
apt-get --no-install-recommends install -y apt-utils && \
rm -rf /var/lib/apt/lists/*
# Locale
ENV LOCALE es_ES.UTF-8
# Default Document root.
ENV DEFAULT_ROOT=/var/www/html
RUN apt-get update --fix-missing \
&& apt-get install -y \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libpng-dev \
libxslt1-dev \
git \
build-essential \
locales \
libssl-dev \
mariadb-client \
mariadb-server \
vim \
wget \
lynx \
psmisc \
unzip \
tree \
zip \
gzip \
cron \
htop \
tree \
libzip-dev \
libncurses5 \
curl \
libcurl4 \
libcurl4-openssl-dev \
&& apt-get clean
# Install locale
RUN apt-get -qq update && \
sed -i -e "s/# $LOCALE/$LOCALE/" /etc/locale.gen && \
echo "LANG=$LOCALE">/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=$LOCALE && \
apt-get -q autoclean && rm -rf /var/lib/apt/lists/*
# Install useful tools and install important libaries
RUN apt-get -y update && \
apt-get -y --no-install-recommends install nano wget dialog libsqlite3-dev libsqlite3-0 && \
apt-get -y --no-install-recommends install default-mysql-client zlib1g-dev libzip-dev libicu-dev && \
apt-get -y --no-install-recommends install --fix-missing apt-utils build-essential git curl libonig-dev && \
apt-get -y --no-install-recommends install --fix-missing libcurl4 libcurl4-openssl-dev zip openssl && \
rm -rf /var/lib/apt/lists/* && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install xdebug
RUN pecl install xdebug-2.8.0 && \
docker-php-ext-enable xdebug
# Install Freetype
RUN apt-get -y update && \
apt-get --no-install-recommends install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure gd
ADD php.ini /usr/local/etc/php/conf.d/888-auren.ini
ADD crontab /etc/crontab
ADD start.sh /start.sh
ADD 000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN usermod -u 33 www-data;
# Configure needed apache modules and disable default site
RUN a2dismod mpm_event cgi # mpm_worker enabled.
RUN a2enmod \
access_compat \
actions \
alias \
auth_basic \
authn_core \
authn_file \
authz_core \
authz_groupfile \
authz_host \
authz_user \
autoindex \
dir \
env \
expires \
filter \
headers \
mime \
negotiation \
mpm_prefork \
reqtimeout \
rewrite \
setenvif \
status \
ssl
# Other PHP7 Extensions
RUN docker-php-ext-install pdo_mysql && \
docker-php-ext-install pdo_sqlite && \
docker-php-ext-install mysqli && \
docker-php-ext-install curl && \
docker-php-ext-install tokenizer && \
docker-php-ext-install json && \
docker-php-ext-install zip && \
docker-php-ext-install -j$(nproc) intl && \
docker-php-ext-install mbstring && \
docker-php-ext-install gettext
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
RUN chmod +x /usr/bin/composer
RUN apt-get install apt-transport-https
RUN apt-get update && apt-get install -y gnupg2
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
RUN chown -R www-data.www-data /var/www
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Cleanup
RUN rm -rf /usr/src/*
# Working dir
WORKDIR ${DEFAULT_ROOT}
EXPOSE 80 443
RUN chmod +x /start.sh;
CMD ["/start.sh"]
But then I execute terminal inside container and check if everything is fine with "php --version" I get this error:
www-data@d29d4972facf:~/html$ php --version
php: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by php)
With php 7.1 I didn't have this problem, but I need >= 7.2 in order to work with Symfony 5.
EDIT:
If I add this line:
RUN apt-get install -y libcurl-openssl1.0-dev libcurl3
I get this error:
Package libcurl3 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
However the following packages replace it:
libcurl4
E: Unable to locate package libcurl-openssl1.0-dev
E: Couldn't find any package by glob 'libcurl-openssl1.0-dev'
E: Couldn't find any package by regex 'libcurl-openssl1.0-dev'
E: Package 'libcurl3' has no installation candidate
And also:
E: Unable to locate package libcurl-openssl1.0-dev
E: Couldn't find any package by glob 'libcurl-openssl1.0-dev'
E: Couldn't find any package by regex 'libcurl-openssl1.0-dev'
Upvotes: 0
Views: 3293