Skip to content

Instantly share code, notes, and snippets.

@viktorsteinwand
Last active February 17, 2016 20:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viktorsteinwand/b204dd335b5c99007e15 to your computer and use it in GitHub Desktop.
Save viktorsteinwand/b204dd335b5c99007e15 to your computer and use it in GitHub Desktop.
Easy access to composer/composer docker image
# 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