Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any ways to add some extra extensions ? #23

Open
apsylone opened this issue Aug 18, 2016 · 1 comment
Open

Any ways to add some extra extensions ? #23

apsylone opened this issue Aug 18, 2016 · 1 comment
Assignees
Labels

Comments

@apsylone
Copy link

Hi Mentors :-)

I would like to know if there is any ways to add some extras PHP5 extensions ?
In my case, I would like to add memcached.

Thanks for your anwser :-)

@iteman iteman self-assigned this Aug 19, 2016
@iteman
Copy link
Member

iteman commented Aug 19, 2016

The APP_INIT environment variable can be used for this.

First, write a script as the following:

docker/app-init:

#!/bin/bash

apt-get update
apt-get -y upgrade

apt-get -y install php5-gd
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
   exit $RETVAL
fi

...

Second, specify the script as the value of the APP_INIT_SCRIPT environment variable as the following:

docker-compose.yml:

version: '2'
services:
    app:
        image: "phpmentors/symfony-app:php55"
        ...
        environment:
            APP_INIT_SCRIPT: "docker/app-init"
        ...

If the value of the APP_INIT_SCRIPT environment variable is relative path, /var/app will be added to the beginning of the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants