Skip to content

Instantly share code, notes, and snippets.

@SmetDenis
Last active May 8, 2017 13:35
Show Gist options
  • Save SmetDenis/548b9f75ee756c0a70dd4488e1104ba1 to your computer and use it in GitHub Desktop.
Save SmetDenis/548b9f75ee756c0a70dd4488e1104ba1 to your computer and use it in GitHub Desktop.
# https://marmelab.com/blog/2014/09/10/make-docker-command.html
# If the first argument is "composer"...
ifeq (composer,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "composer"
COMPOSER_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(COMPOSER_ARGS):;@:)
endif
composer:
@mkdir --parent /var/tmp/composer
@sudo docker run -ti \
-v `pwd`:/srv \
-v /var/tmp/composer:/root/.composer \
docker-composer $(COMPOSER_ARGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment