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

Update Zend Server versions to latest releases #18552

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rainviigipuu
Copy link

No description provided.

@rainviigipuu rainviigipuu requested a review from a team as a code owner March 1, 2025 22:30

This comment has been minimized.

@tianon
Copy link
Member

tianon commented Mar 3, 2025

You might've noticed there's no actual changes in the diff, and the CI didn't pick up any image builds. If you check the library file, you'll note the entry references have all been replaced with a comment pointing to docker-library/docs#2475, which points in particular to #16941 (comment) -- if we want to resurrect this image into the actively supported set, we'll need some assurance that it will be actively maintained and that you plan to be responsive to issues with it / GitHub pings about it.

This comment has been minimized.

@rainviigipuu
Copy link
Author

Hello,

I updated the library/php-zenderver file with the only Zend Server version that is currently supported. This version will have updates before the official end of support: https://www.zend.com/products/zend-server. Until then we would like to have updated package available via Docker official images. We are going to update the images once the new version becomes available.

I have question however what should we do once the EOS support time arrives? The same way that it is done now, that we just update the library/php-zendserver by removing all the tags and adding a link to information that it is now end of support?

Is there some timeline how long the tags can be available after end of support?

@rainviigipuu
Copy link
Author

And I do have another question related to the images that are available here: https://hub.docker.com/_/php-zendserver/tags. While I hope that at least 2021 version will have no vulnerabilities once it gets updated, then for example some old images (like 2018 or 9.1 etc) are not going to receive any updates as they are not supported anymore. So the question(s) are:

Is there a way to get rid of those old images there?
Is that common practice that projects have that kind of old images available indefinitely?
Is there a way to update those old images to the latest version before end of support without adding tag-s for them? I understand the ones with tag-s are considered actively supported?

Just trying to understand what is the practice here so we can do some informed decisions what to do (or what we can do) with them.

Best regards,
Rain

@LaurentGoderre
Copy link
Member

Could you please rebase this so there is only your commit in the PR?

This comment has been minimized.

Add Tags for latest supported Zend Server version
Copy link

github-actions bot commented Mar 4, 2025

Diff for b42d6c1:
diff --git a/_bashbrew-arches b/_bashbrew-arches
index 8b13789..21d5bd8 100644
--- a/_bashbrew-arches
+++ b/_bashbrew-arches
@@ -1 +1 @@
-
+amd64
diff --git a/_bashbrew-cat b/_bashbrew-cat
index e5f7034..cb57994 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,3 +1,6 @@
 Maintainers: Heigo Sinilind <hsinilind@perforce.com> (@hsinilind), Rain Viigipuu <rviigipuu@perforce.com> (@rainviigipuu)
 GitRepo: https://github.com/zendtech/php-zendserver-docker.git
-GitCommit: bcd65b82acb4f3b5b67f8c657c52f08bc52d8789
+GitCommit: e4805272dd9a30adff7646f65cb5961c015afa27
+
+Tags: 2021, 2021.4.1, latest
+Directory: 2021
diff --git a/_bashbrew-list b/_bashbrew-list
index e69de29..e2e3113 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -0,0 +1,3 @@
+php-zendserver:2021
+php-zendserver:2021.4.1
+php-zendserver:latest
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index e69de29..471f1b5 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -0,0 +1 @@
+php-zendserver:latest
diff --git a/php-zendserver_latest/.dockerignore b/php-zendserver_latest/.dockerignore
new file mode 100644
index 0000000..312fb80
--- /dev/null
+++ b/php-zendserver_latest/.dockerignore
@@ -0,0 +1,5 @@
+/var/lib/apt/lists/*
+/tmp/*
+/var/tmp/*
+/usr/local/tmp/*
+/usr/local/zend/tmp
\ No newline at end of file
diff --git a/php-zendserver_latest/Dockerfile b/php-zendserver_latest/Dockerfile
new file mode 100644
index 0000000..439258c
--- /dev/null
+++ b/php-zendserver_latest/Dockerfile
@@ -0,0 +1,61 @@
+# Zend Server
+#
+# Version 2021.4.1+b12
+
+FROM ubuntu:20.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+      gnupg
+
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-key 799058698E65316A2E7A4FF42EAE1437F7D2C623
+COPY zend-server.list /etc/apt/sources.list.d/zend-server.list
+RUN export DEBIAN_FRONTEND=noninteractive \
+    && apt-get update && apt-get install -y --no-install-recommends \
+      iproute2 \
+      curl \
+      ca-certificates \
+      libmysqlclient21 \
+      unzip \
+      git \
+      patch \
+      zend-server-nginx=2021.4.1+b12 \
+      zend-server-common=2021.4.1+b12 \
+      php-extra-extensions-zend-server \
+      php-ffi-zend-server \
+    && rm -rf /var/lib/apt/lists/* \
+    && /usr/local/zend/bin/zendctl.sh stop
+
+# "zs-init" is a standard Zend Server cloud initialization package.
+# It has minor tweaks for use within Docker which can be found at https://github.com/zendtech/zs-init/tree/docker
+ENV ZS_INIT_VERSION=0.3
+ENV ZS_INIT_SHA256=e8d441d8503808e9fc0fafc762b2cb80d4a6e68b94fede0fe41efdeac10800cb
+COPY ./zs-init.patch /tmp/zs-init.patch
+RUN curl -fSL -o zs-init.tar.gz "http://repos.zend.com/zs-init/zs-init-docker-${ZS_INIT_VERSION}.tar.gz" \
+    && echo "${ZS_INIT_SHA256} *zs-init.tar.gz" | sha256sum -c - \
+    && mkdir /usr/local/zs-init \
+    && tar xzf zs-init.tar.gz --strip-components=1 -C /usr/local/zs-init \
+    && rm zs-init.tar.gz \
+    && patch -u /usr/local/zs-init/src/Init/Steps/AbstractStep.php -i /tmp/zs-init.patch \
+    && rm /tmp/zs-init.patch
+
+#Install composer and dependencies for zs-init
+WORKDIR /usr/local/zs-init
+RUN /usr/local/zend/bin/php -r "readfile('https://getcomposer.org/installer');" | /usr/local/zend/bin/php \
+    && /usr/local/zend/bin/php composer.phar update
+
+COPY ./scripts /usr/local/bin 
+#Copy Zray docker plugin
+#TODO: Integrate Zray docker plugin into Zend Server
+COPY ./Zray /usr/local/zend/var/plugins/
+
+RUN rm /var/www/html/index.nginx-debian.html
+COPY ./app /var/www/html
+
+EXPOSE 80
+EXPOSE 443
+EXPOSE 10081
+EXPOSE 10082
+
+WORKDIR /var/www/html
+
+CMD ["/usr/local/bin/run"]
diff --git a/php-zendserver_latest/Zray/Docker/zray/Module.php b/php-zendserver_latest/Zray/Docker/zray/Module.php
new file mode 100644
index 0000000..d3fd891
--- /dev/null
+++ b/php-zendserver_latest/Zray/Docker/zray/Module.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Docker;
+
+class Module extends \ZRay\ZRayModule {
+	
+	public function config() {
+	    return array(
+	        'extension' => array(
+				'name' => 'Docker',
+			),
+	        'defaultPanels' => array(
+	        ),
+	        'panels' => array(
+	            'info' => array(
+	                'display'       => true,
+			'alwaysShow' => true,
+	                'logo'          => 'logo.png',
+	                'menuTitle' 	=> 'Docker',
+	                'panelTitle'	=> 'Docker',
+	            ),
+	         )
+	    );
+	}	
+}
diff --git a/php-zendserver_latest/Zray/Docker/zray/Panels/info.phtml b/php-zendserver_latest/Zray/Docker/zray/Panels/info.phtml
new file mode 100644
index 0000000..5779090
--- /dev/null
+++ b/php-zendserver_latest/Zray/Docker/zray/Panels/info.phtml
@@ -0,0 +1,29 @@
+<div style="padding: 40px;">
+	<div style="font-weight: bold; padding-bottom: 20px;">Container Info</div>
+	<table>
+		<tr>
+			<td style="width: 400px;">
+				Container internal IP
+			</td>
+			<td>
+				<?php echo $_SERVER['SERVER_ADDR'];?>
+			</td>
+		</tr>
+                <tr>
+                        <td>
+                                Remote Address 
+                        </td>
+                        <td>
+                                <?php echo $_SERVER['REMOTE_ADDR'];?>
+                        </td>
+                </tr>
+                <tr>
+                        <td>
+                                Container ID
+                        </td>
+                        <td>
+                                <?php echo gethostname();?>
+                        </td>
+                </tr>
+	</table>
+</div>
diff --git a/php-zendserver_latest/Zray/Docker/zray/logo.png b/php-zendserver_latest/Zray/Docker/zray/logo.png
new file mode 100644
index 0000000..16cc2b9
Binary files /dev/null and b/php-zendserver_latest/Zray/Docker/zray/logo.png differ
diff --git a/php-zendserver_latest/Zray/Docker/zray/zray.php b/php-zendserver_latest/Zray/Docker/zray/zray.php
new file mode 100644
index 0000000..3f481e7
--- /dev/null
+++ b/php-zendserver_latest/Zray/Docker/zray/zray.php
@@ -0,0 +1,3 @@
+<?php
+namespace Docker;
+$zre = new \ZRayExtension('Docker', true);
diff --git a/php-zendserver_latest/app/index.php b/php-zendserver_latest/app/index.php
new file mode 100644
index 0000000..248305f
--- /dev/null
+++ b/php-zendserver_latest/app/index.php
@@ -0,0 +1,87 @@
+<?php
+echo <<<EOF
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<title>Application Container Created | Zend Server Docker Container</title>
+	<link rel="stylesheet" type="text/css" href="http://static.zend.com/devcloud/style/nimbus.css" />
+	<style type="text/css">
+		h3 { color: #265974; }
+		
+		#congrats-banner { 
+			background: url(http://static.zend.com/devcloud/images/congratulations-box-bkg.png) top left no-repeat; 
+			width: 560px;
+			height: 440px;	
+			position: relative;
+			left: 150px;
+			padding: 44px 60px 15px 53px;
+			line-height: normal; 
+		}
+		
+		#congrats-banner h2 {
+			color: #265974;
+    		        line-height: 1em;
+			font-size: 28pt;
+			font-weight: normal;
+			font-variant: small-caps;
+			margin: 0;
+			padding: 0;
+			float: left;
+			width: 230px;
+		}
+		
+		#upload-code { 
+			position: relative;
+			top: 49px;
+			left: 20px;
+			line-height: 22px;
+		}
+		
+		#upload-code h3 {
+			font-size: 18px;
+		}
+		
+		#whats-this {
+			font-size: 11px;
+			clear: both;
+			position: relative;
+			top: 105px;	
+		}
+		
+		#whats-this h3 { 
+			font-weight: normal;
+		}
+	</style>
+</head>
+
+<body>
+	<div id="main-container">
+		<div id="page-header">
+			<h1>
+				<a href="https://www.zend.com/" style="margin:auto; text-align:center; display:block;"><img src="http://static.zend.com/cmsdata/zend-server/zend-server-logo-330x46px.png" alt="Zend Server PHP" id="page-header-logo"></a>
+			</h1>
+    	</div>
+    	
+    	<div id="congrats-banner">
+    		<h2>your new application container is <strong>up</strong> and <strong>running</strong></h2>
+    		<div id="upload-code">
+    			<h3>Now it's time to visit the Zend Server User Interface:</h3>
+    			<p>Navigate to your container IP on port 10081 or to the redirected port (if applicable) to login.</p>
+    		</div>
+    		
+    		<div id="whats-this">
+    			<h3>What's this?</h3>
+    			<p>
+    				This default message is displayed because the owner of this Zend Server container did not upload any code yet. If you are not the owner of this 
+    				application container, there is not a lot for you to see here... sorry.
+    			</p>
+    		</div>
+    	</div>
+	</div>
+</body>
+
+</html>
+EOF;
+?>
diff --git a/php-zendserver_latest/scripts/modify_license.sh b/php-zendserver_latest/scripts/modify_license.sh
new file mode 100755
index 0000000..d41406d
--- /dev/null
+++ b/php-zendserver_latest/scripts/modify_license.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+#modify_license.sh - generate /etc/zend.lic to allow overriding the default license in the docker container.
+
+#Environment variables:
+#ZEND_LICENSE_ORDER=Order number
+#ZEND_LICENSE_KEY=Serial number
+
+#Check if the ZEND_LICENSE_ORDER and ZEND_LICENSE_KEY environment variables are set
+if (env | grep -q ^ZEND_LICENSE_ORDER= && env | grep -q ^ZEND_LICENSE_KEY=)
+then
+  #Generate zend.lic into a temporary location
+   echo \{\"ZEND_LICENSE_ORDER\":\"${ZEND_LICENSE_ORDER}\",\"ZEND_LICENSE_KEY\":\"$ZEND_LICENSE_KEY\"\} > /tmp/zend.lic && \
+   #move and backup existing zend.lic to /etc
+   mv -b /tmp/zend.lic /etc
+fi
+
+#always exit with status 0 to not interfere with docker container creation
+exit 0
diff --git a/php-zendserver_latest/scripts/nothing b/php-zendserver_latest/scripts/nothing
new file mode 100755
index 0000000..83ec340
Binary files /dev/null and b/php-zendserver_latest/scripts/nothing differ
diff --git a/php-zendserver_latest/scripts/restart_zs_if_pending.sh b/php-zendserver_latest/scripts/restart_zs_if_pending.sh
new file mode 100755
index 0000000..58209fe
--- /dev/null
+++ b/php-zendserver_latest/scripts/restart_zs_if_pending.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+ZEND_SERVER_PATH="/usr/local/zend"
+ZSD_FULL_PATH="${ZEND_SERVER_PATH}/bin/zsd"
+ZSD_DB_PATH="${ZEND_SERVER_PATH}/var/db/zsd.db"
+ZSD_DB_CMD="sqlite3 ${ZSD_DB_PATH}"
+
+#Check if any nodes require restart
+NODE_IDS_REQUIRING_RESTART=$(${ZSD_DB_CMD} <<EOF 
+SELECT NODE_ID FROM ZSD_NODES where STATUS_CODE=3;
+EOF
+)
+
+#Restart pending nodes
+if [ -n "$NODE_IDS_REQUIRING_RESTART" ]
+then
+echo "Executing pending Zend Server restart operations..."
+#TODO: check if ZSD DB is locked
+#If so then restart them by inserting tasks into ZSD sqlite db (TODO: replace with proper API)
+sqlite3 $ZSD_DB_PATH <<EOF
+begin transaction;
+with recursive 
+ nodes_requiring_restart(node_id) as (SELECT NODE_ID FROM ZSD_NODES where STATUS_CODE=3)
+ INSERT INTO ZSD_TASKS (NODE_ID,TASK_ID) VALUES ((SELECT node_id from nodes_requiring_restart),0);
+commit;
+EOF
+
+fi
diff --git a/php-zendserver_latest/scripts/run b/php-zendserver_latest/scripts/run
new file mode 100755
index 0000000..32c6df8
--- /dev/null
+++ b/php-zendserver_latest/scripts/run
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+#Generate password if none was set
+if [ -z $ZEND_ADMIN_PASSWORD ]; then
+	ZEND_ADMIN_PASSWORD=`cat /root/zend-password 2> /dev/null`
+if [ -z $ZEND_ADMIN_PASSWORD ]; then
+    export ZEND_ADMIN_PASSWORD=`date +%s | sha256sum | base64 | head -c 8`
+    echo $ZEND_ADMIN_PASSWORD > /root/zend-password
+fi
+fi
+
+HOSTNAME=`hostname`
+APP_IP=`/sbin/ip addr show eth0| grep inet | awk {'print $2'}| cut -d '/' -f 1`
+
+#Grant permissions on Apache logs
+usermod -a -G adm zend
+
+#Debug
+#sed -i 's/zend_gui.debugModeEnabled = false/zend_gui.debugModeEnabled = true/' /usr/local/zend/gui/config/zs_ui.ini
+#sed -i 's/zend_gui.logVerbosity = NOTICE/zend_gui.logVerbosity = DEBUG/' /usr/local/zend/gui/config/zs_ui.ini
+#sed -i 's/zend_server_daemon.log_verbosity_level=2/zend_server_daemon.log_verbosity_level=5/' /usr/local/zend/etc/zsd.ini
+#sed -i 's/zend_jobqueue.daemon.log_verbosity_level=2/zend_jobqueue.daemon.log_verbosity_level=5/' /usr/local/zend/etc/jqd.ini
+#sed -i 's/zend_monitor.daemon.log_verbosity_level=2/zend_monitor.daemon.log_verbosity_level=5/' /usr/local/zend/etc/monitor_node.ini
+#sed -i 's/zend_deployment.daemon.log_verbosity_level=2/zend_deployment.daemon.log_verbosity_level=5/' /usr/local/zend/etc/zdd.ini
+
+#ZDOCK-15 - allow users to bring their own licenses
+/usr/local/bin/modify_license.sh
+
+#/usr/local/zend/bin/php -d error_reporting=32759 /usr/local/zs-init/init.php
+/usr/local/zend/bin/php -n /usr/local/zs-init/init.php
+
+echo "Zend Server is ready for use
+Your application is available at http://$APP_IP
+To access Zend Server, navigate to http://$APP_IP:10081
+Your admin password is `/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php ZEND_ADMIN_PASSWORD`"
+
+MYSQL_HOSTNAME=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php ZEND_CLUSTER_DB_HOST`
+echo $MYSQL_HOSTNAME
+if [ `echo $MYSQL_HOSTNAME|grep :` ]; then
+        MYSQL_PORT=`echo $MYSQL_HOSTNAME|cut -d":" -f2`
+        MYSQL_HOSTNAME=`echo $MYSQL_HOSTNAME|cut -d":" -f1`
+else
+	MYSQL_PORT=3306
+fi
+MYSQL_USERNAME=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php ZEND_CLUSTER_DB_USER`
+MYSQL_PASSWORD=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php ZEND_CLUSTER_DB_PASSWORD`
+MYSQL_DBNAME=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php ZEND_CLUSTER_DB_NAME`
+NODE_ID=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php NODE_ID`
+WEB_API_KEY_NAME=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php WEB_API_KEY_NAME`
+WEB_API_KEY_HASH=`/usr/local/zend/bin/php -n /usr/local/zs-init/stateValue.php WEB_API_KEY_HASH`
+
+#Define Default application
+/usr/local/zend/bin/zs-client.sh applicationDefine --name=default --baseUrl="http://<default-server>:80/" --zskey=$WEB_API_KEY_NAME --zssecret=$WEB_API_KEY_HASH > /dev/null 2>&1
+
+if [[ -n $MYSQL_HOSTNAME && -n $MYSQL_USERNAME && -n $MYSQL_PASSWORD && -n $NODE_ID ]]; then
+echo "Adding Node Id to DB table for sigterm handler"
+#exec /usr/local/bin/nothing $MYSQL_HOSTNAME $MYSQL_PORT $MYSQL_USERNAME $MYSQL_PASSWORD $MYSQL_DBNAME $NODE_ID $WEB_API_KEY_NAME $WEB_API_KEY_HASH
+fi
+
+exec /usr/local/bin/nothing
diff --git a/php-zendserver_latest/zend-server.list b/php-zendserver_latest/zend-server.list
new file mode 100644
index 0000000..6bab8a3
--- /dev/null
+++ b/php-zendserver_latest/zend-server.list
@@ -0,0 +1 @@
+deb http://repos.zend.com/zend-server/2021.4/deb_ubuntu20 server non-free
diff --git a/php-zendserver_latest/zs-init.patch b/php-zendserver_latest/zs-init.patch
new file mode 100644
index 0000000..538917e
--- /dev/null
+++ b/php-zendserver_latest/zs-init.patch
@@ -0,0 +1,12 @@
+--- zs-init-docker-0.3/src/Init/Steps/AbstractStep.php	2017-06-14 13:20:38.000000000 +0300
++++ build-php-zendserver-docker/external_src/php-zendserver-docker/2019.0/zs-init-docker-0.3/src/Init/Steps/AbstractStep.php	2020-04-20 17:54:35.000000000 +0300
+@@ -45,7 +45,8 @@
+         if ($log) {
+             $log->log(Log::INFO, "Executing /usr/sbin/service zend-server {$action}");
+         }
+-        exec("/usr/sbin/service zend-server {$action} 2>&1", $output);
++//        exec("/usr/sbin/service zend-server {$action} 2>&1", $output);
++        exec("/usr/sbin/service zend-server {$action} 2>>/var/log/zs-init.log 1>>/var/log/zs-init.log", $output);
+         if ($log) {
+             $log->log(Log::INFO, "Result: " . PHP_EOL . implode(PHP_EOL, $output));
+         }

Relevant Maintainers:

@tianon
Copy link
Member

tianon commented Mar 4, 2025

Am I understanding correctly that there is a period of time during which Zend Server has no "supported" versions? How does that work?

Regarding old versions, we can remove them, but we typically do not unless a maintainer explicitly requests it because they are often of historical interest to users.

Am I understanding that you are agreeing to maintaining this image more actively in the future than we've seen in the past?

Also, relevant to https://github.com/docker-library/official-images#what-are-official-images, I should verify before we agree to resurrection here that Zend Server is Open Source (pursuant to the OSI's definition of such)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants