{"id":14155242,"url":"https://github.com/marmelab/make-docker-command","last_synced_at":"2025-04-22T21:32:07.591Z","repository":{"id":20583055,"uuid":"23863655","full_name":"marmelab/make-docker-command","owner":"marmelab","description":"Seamlessly execute commands (composer, bower, compass) in isolation using docker and make.","archived":false,"fork":false,"pushed_at":"2016-11-23T09:55:05.000Z","size":7,"stargazers_count":84,"open_issues_count":0,"forks_count":20,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-21T06:08:49.914Z","etag":null,"topics":["docker","make"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marmelab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-10T06:38:29.000Z","updated_at":"2024-09-26T02:43:12.000Z","dependencies_parsed_at":"2022-07-25T00:02:01.131Z","dependency_job_id":null,"html_url":"https://github.com/marmelab/make-docker-command","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marmelab%2Fmake-docker-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marmelab%2Fmake-docker-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marmelab%2Fmake-docker-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marmelab%2Fmake-docker-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marmelab","download_url":"https://codeload.github.com/marmelab/make-docker-command/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250328610,"owners_count":21412651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","make"],"created_at":"2024-08-17T08:02:34.728Z","updated_at":"2025-04-22T21:32:07.311Z","avatar_url":"https://github.com/marmelab.png","language":"Makefile","funding_links":[],"categories":["docker"],"sub_categories":[],"readme":"make-docker-command\n===================\n\nSeamlessly execute commands (composer, bower, compass) in isolation using docker and make.\n\n```bash\n# Install bower dependencies, without installing npm or bower locally\n$ make bower install\n\n# compile compass stylesheets, without installing ruby or compass locally\n$ make compass build\n\n# install composer dependencies faqster using HHVM, without installing HHVM locally\n$ make composer install\n```\n\nmake-docker-command doesn't change the syntax of your favorite commands: just prepend `make`, and the command runs in a docker container. It uses docker images hosted on Docker Hub, and generates files with the right user credentials.\n\nmake-docker-command currently supports the following dockerized commands:\n\n* [composer](https://github.com/marmelab/make-docker-command#composer)\n* [phpunit](https://github.com/marmelab/make-docker-command#phpunit)\n* [bower](https://github.com/marmelab/make-docker-command#bower)\n* [compass](https://github.com/marmelab/make-docker-command#compass)\n\n**Tip**: For command invocations with an option (like `--prefer-source`), use `make --` instead of `make`:\n\n```bash\n$ make -- composer install --prefer-source\n```\n\nmake-docker-command requires Docker 1.2, and works both on Linux and OSX.\n\nFor more details about the intention and the implementation, see [the make-docker-command introduction post on the marmelab blog](http://marmelab.com/blog/2014/09/10/make-docker-command.html).\n\n## Installation\n\nCopy the content of the `Makefile` from this repository to the `Makefile` of the projects you're working on. \n\n## Sharing SSH Keys\n\nSome commands may require SSH keys to connect to a secured repository (e.g. GitHub). make-docker-command will use the identity and hosts file declared in the `DOCKER_SSH_IDENTITY` and `DOCKER_SSH_KNOWN_HOSTS` environment variables (default to `~/.ssh/id_rsa` and `~/.ssh/known_hosts`).\n\nIf you don't want to enter a passphrase each time use these keys, create a new SSH key pair without passphrase and authorize it on GitHub:\n\n```bash\n$ cd ~/.ssh\n$ mkdir docker_identity \u0026\u0026 cd docker_identity\n$ ssh-keygen -t rsa -f id_rsa -N ''\n$ ssh-keyscan -t rsa github.com \u003e known_hosts\n```\n\nThen modify the environment variable to let `make-docker-command` use the new key:\n\n```bash\n$ export DOCKER_SSH_IDENTITY=\"~/.ssh/docker_identity/id_rsa\"\n$ export DOCKER_SSH_KNOWN_HOSTS=\"~/.ssh/docker_identity/known_hosts\"\n```\n\n## Performance\n\nCommands executed in a docker container run in about the same time on Linux. On OS X, commands with lots of disk I/Os are much slower when run inside a container. This is currently addressed by the Docker core team.\n\n## Supported Commands\n\n### composer\n\nInstall composer dependencies using the [marmelab/composer-hhvm](https://registry.hub.docker.com/u/marmelab/composer-hhvm/) docker image, running composer on HHVM (faster than PHP).\n\n```bash\n$ make composer install\n```\n\nThe composer cache persists between runs. The `vendor` directory is created using the current user name and group. Private repositories are fetched using the SSH identity file. \n\n### phpunit\n\nRun PHP unit tests using the [marmelab/phpunit-hhvm](https://registry.hub.docker.com/u/marmelab/phpunit-hhvm/) docker image, running phpunit on HHVM (faster than PHP).\n\n```bash\n$ make phpunit\n```\n\n### bower\n\nUses the [marmelab/bower](https://registry.hub.docker.com/u/marmelab/bower/) docker image, running bower on npm.\n\n```bash\n$ make bower install\n```\n\nThe bower cache persists between runs. The `bower_components` directory is created using the current user name and group. Private repositories are fetched using the SSH identity file. \n\n### compass\n\nUses the [marmelab/compass](https://registry.hub.docker.com/u/marmelab/compass/) docker image, running bower on ruby.\n\n```bash\n$ make compass build\n```\n\n## Troubleshooting\n\n### Not using sudo / root\n\nThe user executing `make command` must be a member of the `docker` group to avoid using sudo:\n\n```bash\n$ sudo groupadd docker\n$ sudo gpasswd -a my_user docker\n$ sudo service docker restart\n```\n\n### WARNING: No swap limit support\n\nThis warning shouldn't prevent the command from running, but the message means that your system needs an additional LXC configuration. See [the official Docker documentation](http://docs.docker.com/installation/ubuntulinux/#memory-and-swap-accounting) for the solution.\n\n### Permission Problem For Executing HHVM\n\nOn hosts using AppArmor, docker containers can't execute commands as non-root, even if the executable bit is set for all. Try the following commands on the host:\n\n```bash\n$ apt-get install apparmor-utils\n$ aa-complain /usr/bin/lxc-start\n$ aa-complain /usr/bin/docker\n```\n\n### OS X\n\nDocker on OS X is still rough in the edges, and you'll need [a custom version of boot2docker](https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c), allowing volume mounting, to get this working.\n\nmake-docker-command will only work when called from under the `/Users/` directory (because that's the only directory shered between the host and the VM).\n\n## License\n\nmake-docker-command is available under the [MIT license](https://github.com/marmelab/make-docker-command/blob/master/LICENSE), courtesy of marmelab. \n\nComments and pull requests are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarmelab%2Fmake-docker-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarmelab%2Fmake-docker-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarmelab%2Fmake-docker-command/lists"}