Skip to content

Instantly share code, notes, and snippets.

@ivarref
Last active September 7, 2016 11:45
Show Gist options
  • Save ivarref/bcd023a85cb01c26715889658317087f to your computer and use it in GitHub Desktop.
Save ivarref/bcd023a85cb01c26715889658317087f to your computer and use it in GitHub Desktop.
Allow Dockerfiles to be executed with the help of PHP
#!/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