From c4721cd985d9416143b9aa141cec7f2d353adfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Mon, 5 Feb 2018 09:53:32 +0100 Subject: [PATCH] add a perl example --- Dockerfile | 11 ++++++++--- share/cgi-bin/welcome-pl.cgi | 10 ++++++++++ share/cgi-bin/{welcome.cgi => welcome-sh.cgi} | 0 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 share/cgi-bin/welcome-pl.cgi rename share/cgi-bin/{welcome.cgi => welcome-sh.cgi} (100%) diff --git a/Dockerfile b/Dockerfile index c365fea..ba26f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,14 @@ FROM registry.access.redhat.com/rhscl/httpd-24-rhel7:latest +# CGI scripts go to /opt/rh/httpd24/root/var/www/cgi-bin/ ADD share/cgi-bin /opt/rh/httpd24/root/var/www/cgi-bin/ + +# Static files go to /opt/rh/httpd24/root/var/www/html ADD share/html /opt/rh/httpd24/root/var/www/html -VOLUME /ogl/data +# Install missing Perl modules +RUN yum update -y \ + && yum install -y perl-CGI perl-Sys-CPU \ + && yum clean all \ + && rm -rf /var/cache/yum -ENTRYPOINT [ "/usr/bin/run-httpd" ] -CMD [ ] diff --git a/share/cgi-bin/welcome-pl.cgi b/share/cgi-bin/welcome-pl.cgi new file mode 100755 index 0000000..3246f2a --- /dev/null +++ b/share/cgi-bin/welcome-pl.cgi @@ -0,0 +1,10 @@ +#!/usr/bin/perl -w +use CGI; +use Sys::CPU; +$number_of_cpus = Sys::CPU::cpu_count(); +$q = CGI->new; +print $q->header, + $q->start_html('hello world'), + $q->h1('hello world'), + $q->pre('CPU Count: '.Sys::CPU::cpu_count()."\nSpeed: ".Sys::CPU::cpu_clock()."\nType: ".Sys::CPU::cpu_type()."\n"), + $q->end_html; diff --git a/share/cgi-bin/welcome.cgi b/share/cgi-bin/welcome-sh.cgi similarity index 100% rename from share/cgi-bin/welcome.cgi rename to share/cgi-bin/welcome-sh.cgi