diff --git a/.travis.yml b/.travis.yml index 9a590e4..8fd8b5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ env: - DOCKERFILE_DIR=memcached - DOCKERFILE_DIR=mixer-ci - DOCKERFILE_DIR=nginx + - DOCKERFILE_DIR=php - DOCKERFILE_DIR=postgres - DOCKERFILE_DIR=python - DOCKERFILE_DIR=redis diff --git a/php/Dockerfile b/php/Dockerfile new file mode 100644 index 0000000..121e78b --- /dev/null +++ b/php/Dockerfile @@ -0,0 +1,10 @@ +FROM clearlinux:latest +MAINTAINER jianjun.liu@intel.com + +ARG swupd_args + +RUN swupd update $swupd_args \ + && swupd bundle-add php-basic $swupd_args \ + && rm -rf /var/lib/swupd/* + +CMD ["php","-a"] diff --git a/php/README.md b/php/README.md new file mode 100644 index 0000000..e3779a8 --- /dev/null +++ b/php/README.md @@ -0,0 +1,43 @@ +php +========== +This provides a Clear Linux* php basic cli instance. + +Build +----- +``` +docker build -t clearlinux/php . +``` + +Or just pull it from Dockerhub +--------------------------- +``` +docker pull clearlinux/php +``` + +start a php instance +----------------------- +``` +docker run --name some-php clearlinux/php +``` + +Run my own php instance +----------------------- +Create a Dockerfile in your own php project +``` +FROM clearlinux/php:latest +COPY . /usr/src/myphpapp +WORKDIR /usr/src/myphpapp +CMD [ "php", "./my-script.php" ] +``` + +Then, run the commands to build and run the Docker image: +``` +$ docker build -t my-own-php-instance . +$ docker run -it --rm --name my-running-php my-own-php-instance +``` + +Extra Build ARGs +---------------- +- ``swupd_args`` Specifies [SWUPD](https://clearlinux.org/documentation/swupdate_how_to_run_the_updater.html) flags + +Default build args in Docker are on: https://docs.docker.com/engine/reference/builder/#arg diff --git a/php/helloworld.php b/php/helloworld.php new file mode 100644 index 0000000..c4b9f1d --- /dev/null +++ b/php/helloworld.php @@ -0,0 +1 @@ +