Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP8.1 #138

Merged
merged 4 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions 8.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# vim:set ft=dockerfile:

FROM cimg/base:2021.11

LABEL maintainer="Community & Partner Engineering Team <community-partner@circleci.com>"

ENV PHP_VERSION 8.1.0
ENV PHP_MINOR 8.1

# Install dependencies
RUN sudo apt-get update && sudo apt-get install -y \
autoconf \
bison \
build-essential \
libcurl4-openssl-dev \
libfreetype6-dev \
libjpeg-dev \
libonig-dev \
libpng-dev \
libreadline-dev \
libsodium-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libwebp-dev \
libxml2-dev \
libxpm-dev \
libzip-dev \
re2c \
zlib1g-dev \
&& \
sudo rm -rf /var/lib/apt/lists/* && \

curl -sSL "https://www.php.net/distributions/php-${PHP_VERSION}.tar.gz" | tar -xz && \
cd "php-${PHP_VERSION}" && \
./buildconf && \
./configure \
--enable-bcmath \
--enable-fpm \
--enable-gd \
--enable-intl \
--enable-mbstring \
--enable-pcntl \
--enable-phpdbg \
--enable-sockets \
--enable-exif \
--enable-zip \
--enable-soap \
--with-config-file-scan-dir=/etc/php.d \
--with-curl \
--with-freetype \
--with-jpeg \
--with-mysqli=mysqlnd \
--with-pear \
--with-pdo-mysql=mysqlnd \
--with-pdo-pgsql \
--with-pdo-sqlite \
--with-pgsql \
--with-openssl \
--with-readline \
--with-sodium \
--with-webp \
--with-xpm \
--with-zip \
--with-zlib \
&& \
make -j $(nproc) && \
sudo make install && \
cd .. && \
rm -r php-${PHP_VERSION} && \
sudo mkdir -p /etc/php.d && \
echo 'memory_limit = -1' | sudo tee -a /etc/php.d/circleci.ini && \
sudo pear config-set php_ini /etc/php.d/circleci.ini && \
sudo pecl update-channels && \

# Check things are as they should be
# We likely don't need to test EVERYTHING here. What is important is to
# test for extensions where the installation method has changed between
# releases. For example, if we decide to use this template back for older
# PHP releases, the way `gd` is enabled at compile time changed.
php --version | grep "${PHP_VERSION}" || ( echo "Error: PHP version installed is not correct." && exit 1 ) && \
php -m | grep "gd" && \
php -m | grep "sockets"

# Install the PHP package manager Composer
ENV COMPOSER_VERSION 2.1.12
RUN sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
sudo php composer-setup.php --version=$COMPOSER_VERSION --install-dir=/usr/local/bin --filename=composer && \
sudo php -r "unlink('composer-setup.php');" && \
composer --version
ENV PATH /home/circleci/.config/composer/vendor/bin:/home/circleci/.composer/vendor/bin:$PATH
63 changes: 63 additions & 0 deletions 8.1/browsers/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# vim:set ft=dockerfile:

FROM cimg/php:8.1.0-node

LABEL maintainer="CircleCI Community & Partner Engineering Team <community-partner@circleci.com>"

# Install Selenium
ENV SELENIUM_VER=3.141.59
RUN curl -sSL -o selenium-server-standalone-${SELENIUM_VER}.jar "https://selenium-release.storage.googleapis.com/${SELENIUM_VER%.*}/selenium-server-standalone-${SELENIUM_VER}.jar" && \
sudo cp selenium-server-standalone-${SELENIUM_VER}.jar /usr/local/bin/selenium.jar && \
rm selenium-server-standalone-${SELENIUM_VER}.jar

RUN sudo apt-get update && \

# Install Java only if it's not already available
# Java is installed for Selenium
if ! command -v java > /dev/null; then \
echo "Java not found in parent image, installing..." && \
sudo apt-get install -y --no-install-recommends --no-upgrade openjdk-11-jre; \
fi && \

# Firefox deps
sudo apt-get install -y --no-install-recommends --no-upgrade \
libdbus-glib-1-2 \
libgtk-3-dev \
libxt6 \
&& \

# Google Chrome deps
# Some of these packages should be pulled into their own section
sudo apt-get install -y --no-install-recommends --no-upgrade \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libatspi2.0-0 \
libcairo2 \
libcups2 \
libgbm1 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libxcursor1 \
libxss1 \
xdg-utils \
xvfb \
&& \
sudo rm -rf /var/lib/apt/lists/*

# Below is setup to allow xvfb to start when the container starts up.
# The label in particular allows this image to override what CircleCI does
# when booting the image.
LABEL com.circleci.preserve-entrypoint=true
ENV DISPLAY=":99"
#RUN printf '#!/bin/sh\nXvfb :99 -screen 0 1280x1024x24 &\nexec "$@"\n' > /tmp/entrypoint && \
# chmod +x /tmp/entrypoint && \
# sudo mv /tmp/entrypoint /docker-entrypoint.sh
RUN printf '#!/bin/sh\nXvfb :99 -screen 0 1280x1024x24 &\nexec "$@"\n' | sudo tee /docker-entrypoint.sh && \
sudo chmod +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/bin/sh"]
20 changes: 20 additions & 0 deletions 8.1/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# vim:set ft=dockerfile:

FROM cimg/php:8.1.0

LABEL maintainer="Community & Partner Engineering Team <community-partner@circleci.com>"

# Dockerfile will pull the latest LTS release from cimg-node.
RUN curl -sSL "https://raw.githubusercontent.com/CircleCI-Public/cimg-node/master/ALIASES" -o nodeAliases.txt && \
NODE_VERSION=$(grep "lts" ./nodeAliases.txt | cut -d "=" -f 2-) && \
curl -L -o node.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" && \
sudo tar -xJf node.tar.xz -C /usr/local --strip-components=1 && \
rm node.tar.xz nodeAliases.txt && \
sudo ln -s /usr/local/bin/node /usr/local/bin/nodejs

ENV YARN_VERSION 1.22.5
RUN curl -L -o yarn.tar.gz "https://yarnpkg.com/downloads/${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz" && \
sudo tar -xzf yarn.tar.gz -C /opt/ && \
rm yarn.tar.gz && \
sudo ln -s /opt/yarn-v${YARN_VERSION}/bin/yarn /usr/local/bin/yarn && \
sudo ln -s /opt/yarn-v${YARN_VERSION}/bin/yarnpkg /usr/local/bin/yarnpkg
2 changes: 1 addition & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim:set ft=dockerfile:

FROM cimg/%%PARENT%%:2021.10
FROM cimg/%%PARENT%%:2021.11

LABEL maintainer="Community & Partner Engineering Team <community-partner@circleci.com>"

Expand Down
3 changes: 3 additions & 0 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ docker build --file 7.4/browsers/Dockerfile -t cimg/php:7.4.26-browsers -t cimg
docker build --file 8.0/Dockerfile -t cimg/php:8.0.13 -t cimg/php:8.0 .
docker build --file 8.0/node/Dockerfile -t cimg/php:8.0.13-node -t cimg/php:8.0-node .
docker build --file 8.0/browsers/Dockerfile -t cimg/php:8.0.13-browsers -t cimg/php:8.0-browsers .
docker build --file 8.1/Dockerfile -t cimg/php:8.1.0 -t cimg/php:8.1 .
docker build --file 8.1/node/Dockerfile -t cimg/php:8.1.0-node -t cimg/php:8.1-node .
docker build --file 8.1/browsers/Dockerfile -t cimg/php:8.1.0-browsers -t cimg/php:8.1-browsers .