Last active
February 17, 2016 20:56
-
-
Save viktorsteinwand/b204dd335b5c99007e15 to your computer and use it in GitHub Desktop.
Easy access to composer/composer docker image
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
# This shell script can be used for easier accessing the composer/composer docker image (https://hub.docker.com/r/composer/composer/) | |
Create new composer file | |
```sh | |
sudo vim /usr/local/bin/composer | |
``` | |
The contents of the file will look like this: | |
```sh | |
#!/bin/sh | |
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin | |
echo "Current working directory: '"$(pwd)"'" | |
docker run --rm -v $(pwd):/app -v ~/.ssh:/root/.ssh composer/composer $@ | |
``` | |
Once the script has been made, it must be set as executable | |
```sh | |
sudo chmod +x /usr/local/bin/composer | |
``` | |
Now the `composer` command is available native on host: | |
```sh | |
composer --version | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment