GithubHelp home page GithubHelp logo

php7-docker's Introduction

PHP 7 in Docker

Docker container with PHP 7 (nightly)

Features / Aims

  • Allow people to run unit tests with PHP with a 1 line setup & without much to download
  • Get people trying out PHP 7's new features

Usage

Note: you don't need to do anything with this repo, docker will pull the image for you the 1st time you use it.

If you don't have docker, run sudo apt-get install docker or similar on your machine.

Run a PHP file

docker run -it --rm --name my-php7 -v "$(pwd)":/tmp -w /tmp dave1010/php-nightly "php ./path/to/file.php"

You can run executable PHP files (chmod a+x) directly, eg running PHPUnit

docker run -it --rm --name my-php7 -v "$(pwd)":/tmp -w /tmp dave1010/php-nightly ./vendor/bin/phpunit

This is quite a long command, so you can alias it:

alias php7='docker run -it --rm --name my-php7 -v "$(pwd)":/tmp -w /tmp dave1010/php-nightly'
php7 ./vendor/bin/phpunit

Check out the examples in this repo for some more PHP 7 goodness.

Building

This is optional -- only needed if you want to change stuff -- as I've packaged it on Docker hub.

Something like this:

docker build -t php-nightly .
docker ps -a
docker commit <hash> php:nightly

TODO

Pull requests welcome!

  • Make so you don't need "php file.php --args" in quotes
  • Clean up images, so they're just a few MB, rather than 100s.
  • PHP extensions
  • Add details to the package on Docker hub
  • Make it easy / automated to update to the latest nightly / check out different branches of php-src
  • More PHP 7 examples

php7-docker's People

Contributors

dave1010 avatar

Watchers

Arnstein Henriksen avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.