Apply markdownfmt
This commit is contained in:
parent
bc5cd482ec
commit
5accd167e8
|
|
@ -13,7 +13,7 @@ You can read more about Composer in our [official documentation](https://getcomp
|
||||||
Running the `composer` image is as simple as follows:
|
Running the `composer` image is as simple as follows:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker run --rm --interactive --tty \
|
$ docker run --rm --interactive --tty \
|
||||||
--volume $PWD:/app \
|
--volume $PWD:/app \
|
||||||
%%IMAGE%% install
|
%%IMAGE%% install
|
||||||
```
|
```
|
||||||
|
|
@ -23,7 +23,7 @@ docker run --rm --interactive --tty \
|
||||||
You can bind mount the Composer home directory from your host to the container to enable a persistent cache or share global configuration:
|
You can bind mount the Composer home directory from your host to the container to enable a persistent cache or share global configuration:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker run --rm --interactive --tty \
|
$ docker run --rm --interactive --tty \
|
||||||
--volume $PWD:/app \
|
--volume $PWD:/app \
|
||||||
--volume $COMPOSER_HOME:/tmp \
|
--volume $COMPOSER_HOME:/tmp \
|
||||||
%%IMAGE%% install
|
%%IMAGE%% install
|
||||||
|
|
@ -34,9 +34,9 @@ docker run --rm --interactive --tty \
|
||||||
Or if you are following the XDG specification:
|
Or if you are following the XDG specification:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
COMPOSER_HOME=$HOME/.config/composer \
|
$ COMPOSER_HOME=$HOME/.config/composer \
|
||||||
COMPOSER_CACHE_DIR=$HOME/.cache/composer \
|
COMPOSER_CACHE_DIR=$HOME/.cache/composer \
|
||||||
docker run --rm --interactive --tty \
|
docker run --rm --interactive --tty \
|
||||||
--env COMPOSER_HOME \
|
--env COMPOSER_HOME \
|
||||||
--env COMPOSER_CACHE_DIR \
|
--env COMPOSER_CACHE_DIR \
|
||||||
--volume $COMPOSER_HOME:$COMPOSER_HOME \
|
--volume $COMPOSER_HOME:$COMPOSER_HOME \
|
||||||
|
|
@ -50,7 +50,7 @@ docker run --rm --interactive --tty \
|
||||||
By default, Composer runs as root inside the container. This can lead to permission issues on your host filesystem. You can work around this by running the container with a different user:
|
By default, Composer runs as root inside the container. This can lead to permission issues on your host filesystem. You can work around this by running the container with a different user:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker run --rm --interactive --tty \
|
$ docker run --rm --interactive --tty \
|
||||||
--volume $PWD:/app \
|
--volume $PWD:/app \
|
||||||
--user $(id -u):$(id -g) \
|
--user $(id -u):$(id -g) \
|
||||||
%%IMAGE%% install
|
%%IMAGE%% install
|
||||||
|
|
@ -61,7 +61,7 @@ docker run --rm --interactive --tty \
|
||||||
When you need to access private repositories, you will either need to share your configured credentials, or mount your `ssh-agent` socket inside the running container:
|
When you need to access private repositories, you will either need to share your configured credentials, or mount your `ssh-agent` socket inside the running container:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker run --rm --interactive --tty \
|
$ docker run --rm --interactive --tty \
|
||||||
--volume $PWD:/app \
|
--volume $PWD:/app \
|
||||||
--volume $SSH_AUTH_SOCK:/ssh-auth.sock \
|
--volume $SSH_AUTH_SOCK:/ssh-auth.sock \
|
||||||
--env SSH_AUTH_SOCK=/ssh-auth.sock \
|
--env SSH_AUTH_SOCK=/ssh-auth.sock \
|
||||||
|
|
@ -73,7 +73,7 @@ docker run --rm --interactive --tty \
|
||||||
When combining the use of private repositories with running Composer as another user, you might run into non-existent user errors (thrown by ssh). To work around this, simply mount the host passwd and group files (read-only) into the container:
|
When combining the use of private repositories with running Composer as another user, you might run into non-existent user errors (thrown by ssh). To work around this, simply mount the host passwd and group files (read-only) into the container:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker run --rm --interactive --tty \
|
$ docker run --rm --interactive --tty \
|
||||||
--volume $PWD:/app \
|
--volume $PWD:/app \
|
||||||
--volume $SSH_AUTH_SOCK:/ssh-auth.sock \
|
--volume $SSH_AUTH_SOCK:/ssh-auth.sock \
|
||||||
--volume /etc/passwd:/etc/passwd:ro \
|
--volume /etc/passwd:/etc/passwd:ro \
|
||||||
|
|
@ -91,23 +91,23 @@ Our image is aimed at quickly running Composer without the need for having a PHP
|
||||||
|
|
||||||
Suggestions:
|
Suggestions:
|
||||||
|
|
||||||
* use [`--ignore-platform-reqs`](https://getcomposer.org/doc/03-cli.md#install-i):
|
- use [`--ignore-platform-reqs`](https://getcomposer.org/doc/03-cli.md#install-i):
|
||||||
|
|
||||||
```console
|
```console
|
||||||
composer install --ignore-platform-reqs
|
$ composer install --ignore-platform-reqs
|
||||||
```
|
```
|
||||||
|
|
||||||
* specify the target [platform](https://getcomposer.org/doc/06-config.md#platform) in your `composer.json`:
|
- specify the target [platform](https://getcomposer.org/doc/06-config.md#platform) in your `composer.json`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "7.1.3"
|
"php": "7.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### PHP extensions
|
### PHP extensions
|
||||||
|
|
||||||
|
|
@ -118,14 +118,14 @@ Suggestions:
|
||||||
- pass the `--ignore-platform-reqs` and / or `--no-scripts` flags to `install` or `update`:
|
- pass the `--ignore-platform-reqs` and / or `--no-scripts` flags to `install` or `update`:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker run --rm --interactive --tty \
|
$ docker run --rm --interactive --tty \
|
||||||
--volume $PWD:/app \
|
--volume $PWD:/app \
|
||||||
%%IMAGE%% install --ignore-platform-reqs --no-scripts
|
%%IMAGE%% install --ignore-platform-reqs --no-scripts
|
||||||
```
|
```
|
||||||
|
|
||||||
- create your own buid image and [install](https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md) Composer inside it.
|
- create your own buid image and [install](https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md) Composer inside it.
|
||||||
|
|
||||||
**Note:** Docker 17.05 introduced [multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/), simplifying this enormously:
|
**Note:** Docker 17.05 introduced [multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/), simplifying this enormously:
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
COPY --from=%%IMAGE%% /usr/bin/composer /usr/bin/composer
|
COPY --from=%%IMAGE%% /usr/bin/composer /usr/bin/composer
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue