Browse Source

add a perl example

master
Nicolas Massé 8 years ago
parent
commit
c4721cd985
  1. 11
      Dockerfile
  2. 10
      share/cgi-bin/welcome-pl.cgi
  3. 0
      share/cgi-bin/welcome-sh.cgi

11
Dockerfile

@ -1,9 +1,14 @@
FROM registry.access.redhat.com/rhscl/httpd-24-rhel7:latest 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/ 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 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 [ ]

10
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;

0
share/cgi-bin/welcome.cgi → share/cgi-bin/welcome-sh.cgi

Loading…
Cancel
Save