Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
First tests passing
Jim Van Fleet committed Jul 29, 2016
1 parent 85aca2f commit 410de79
Showing 3 changed files with 80 additions and 1 deletion.
55 changes: 55 additions & 0 deletions Dockerfile
@@ -0,0 +1,55 @@
FROM bigfleet/centos7base

# Define args and set a default value
ARG maintainer=tier
ARG imagename=lamp
ARG tagname=20160727-dev
ARG version=1.0


MAINTAINER $maintainer
LABEL Vendor="Internet2"
LABEL ImageType="COmanage"
LABEL ImageName=$imagename
LABEL TagName=$tagname
LABEL ImageOS=centos7
LABEL Version=$version

LABEL Build docker build --rm --tag $registry/$maintainer/$imagename:$tagname .

# Install deps.
RUN yum -y install \
httpd \
mysql-devel \
mysql-libs \
mod_ssl \
php \
php-openssl \
php-cli \
php-ldap \
php-mbstring \
php-mcrypt \
php-mysql \
php-pear-MDB2-Driver-mysqli \
php-pecl-memcached \
php-xml \
&& yum clean all

#
# UTC Timezone & Networking
#
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime && \
echo "NETWORKING=yes" > /etc/sysconfig/network

#
# Global PHP configuration changes
#
RUN sed -i \
-e 's~^;date.timezone =$~date.timezone = Europe/Rome~g' \
-e 's~^;user_ini.filename =$~user_ini.filename =~g' \
/etc/php.ini

RUN echo '<?php phpinfo(); ?>' > /var/www/html/index.php

# Port
EXPOSE 80 443
3 changes: 2 additions & 1 deletion common.bash
@@ -1,2 +1,3 @@
maintainer="bigfleet"
imagename="lamp"
imagename="lamp"
version="1.0"
23 changes: 23 additions & 0 deletions tests/image.bats
@@ -0,0 +1,23 @@
#!/usr/bin/env bats

load ../common

setup() {
echo $PWD > test.log
./bin/rebuild.sh
}

@test "Should be buildable" {
run bin/build.sh
[ "$status" -eq 0 ]
}

@test "Concludes first-run experience" {
result="$(docker run -i $maintainer/$imagename find /tmp/firsttimerunning)"
[ "$result" != '' ]
}

@test "Contains php" {
run docker run -i $maintainer/$imagename which php
[ "$status" -eq 0 ]
}

0 comments on commit 410de79

Please sign in to comment.