Last active
September 7, 2016 11:45
-
-
Save ivarref/bcd023a85cb01c26715889658317087f to your computer and use it in GitHub Desktop.
Allow Dockerfiles to be executed with the help of PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/php | |
| #<?php echo "\010"; system("docker build --tag=meh .", $retval); if ($retval==0 && $argc == 2 && $argv[1] == "run") { system("docker run meh", $retval); } exit($retval); /* | |
| # Pre-build: $ chmod +x ./Dockerfile | |
| # To build: $ ./Dockerfile | |
| # To build and run: $ ./Dockerfile run | |
| FROM node:6 | |
| CMD [ "echo", "hello world" ] | |
| # */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment