https://github.com/chesszebra/docker-image-composer
A Docker image to run PHP for a specific version.
https://github.com/chesszebra/docker-image-composer
composer docker php php7 php70 php71
Last synced: 4 months ago
JSON representation
A Docker image to run PHP for a specific version.
- Host: GitHub
- URL: https://github.com/chesszebra/docker-image-composer
- Owner: chesszebra
- License: mit
- Created: 2017-09-05T20:28:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-31T21:23:37.000Z (over 5 years ago)
- Last Synced: 2025-02-26T16:50:10.035Z (about 1 year ago)
- Topics: composer, docker, php, php7, php70, php71
- Language: Shell
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# docker-image-composer
This repository contains the Docker image used to run Composer for a
specific PHP version.
## Usage
To run Composer you should make sure you map a volume to the /data directory within the container:
```
docker run \
--rm \
-it \
-v $(pwd):/data \
chesszebra/composer:php7.0
```
### Caching
It's often a good idea to map your home directory to the container because Composer caches the packages that it
downloads. This will speed up future installations:
```
docker run \
--rm \
-it \
-v $(pwd):/data \
-v ~/.composer:/home/php/.composer
chesszebra/composer:php7.0
```
### SSH Agent Forwarding
Some packages are installed via Git and require your SSH identity. We can forward the SSH agent easily:
```
docker run \
--rm \
-it \
-v $(pwd):/data \
-v $HOME/.ssh:/home/php/.ssh/ \
-v $SSH_AUTH_SOCK:/ssh-agent \
-e SSH_AUTH_SOCK=/ssh-agent \
chesszebra/composer:php7.0
```