HUB
Sign inSign up

cytopia/hhvm-latest

By cytopia

•Updated about 9 years ago

HHVM latest on Ubuntu xenial

Image
0

10K+

cytopia/hhvm-latest repository overview

⁠HHVM latest Docker

Latest build: 2017-09-09

Build Status

cytopia/hhvm-latest

php-fpm 5.4⁠ | php-fpm 5.5⁠ | php-fpm 5.6⁠ | php-fpm 7.0⁠ | php-fpm 7.1⁠ | php-fpm 7.2⁠ | hhvm-latest


HHVM latest Docker on Ubuntu

Devilbox

This docker image is part of the devilbox⁠


⁠Options

Note: HHVM comes with PHP 5.6 and PHP 7 support. This container enables PHP 7 by default. If you want to use this container with PHP 5.6 instead, you will have to mount a custom *.ini file to /etc/php-custom.d containing the following line:

hhvm.php7.all = false

Example for PHP 5.6:

# Your local directory to be mounted
$ ls ./my-php-conf/
php-5.ini

# Contents of your local ini file
$ cat ./my-php-conf/php-5.ini
hhvm.php7.all = false

# Mount your local config into the container
$ docker run -i \
    -v ./my-php-conf:/etc/php-custom.d \
	-t cytopia/hhvm-latest
⁠Environmental variables
⁠Required environmental variables
  • None
⁠Optional environmental variables
VariableTypeDefaultDescription
DEBUG_COMPOSE_ENTRYPOINTbool0Show shell commands executed during start.
Value: 0 or 1
DOCKER_LOGS_ERRORbool0Log errors to docker logs instead of file inside container.
Value: 0 or 1
DOCKER_LOGS_XDEBUGbool0Log php xdebug to docker logs instead of file inside container.
Value: 0 or 1
NEW_UIDinteger1000Assign the default devilbox user a new UID. This is useful if you also want to work inside this container in order to be able to access your mounted files with the same UID. Set it to your host users uid (see id for your uid).
NEW_GIDinteger1000Assign the default devilbox group a new GID. This is useful if you also want to work inside this container in order to be able to access your mounted files with the same GID. Set it to your host group gid (see id for your gid).
TIMEZONEstringUTCSet docker OS timezone as well as PHP timezone.
(Example: Europe/Berlin)
ENABLE_MAILbool0Allow sending emails. Postfix will be configured for local delivery and all sent mails (even to real domains) will be catched locally. No email will ever go out. They will all be stored in a local devilbox account.
Value: 0 or 1
FORWARD_PORTS_TO_LOCALHOSTstring``List of remote ports to forward to 127.0.0.1.
Format: <local-port>:<remote-host>:<remote-port>. You can separate multiple entries by comma.
Example: 3306:mysqlhost:3306, 6379:192.0.1.1:6379
PHP_XDEBUG_ENABLEbool0Enable Xdebug.
Value: 0 or 1
PHP_XDEBUG_REMOTE_PORTint9000The port on your Host (where you run the IDE/editor to which xdebug should connect.)
PHP_XDEBUG_REMOTE_HOSTstring``The IP address of your Host (where you run the IDE/editor to which xdebug should connect).
This is required if $PHP_DEBUG_ENABLE is turned on.
MYSQL_BACKUP_USERstringmds defaultUsername for mysql backups used for bundled mysqldump-secure⁠
MYSQL_BACKUP_PASSstringmds defaultPassword for mysql backups used for bundled mysqldump-secure⁠
MYSQL_BACKUP_HOSTstringmds defaultHostname for mysql backups used for bundled mysqldump-secure⁠
⁠Default mount points
DockerDescription
/var/log/phpHHVM log dir
/etc/php-custom.dCustom user configuration files. Make sure to mount this folder to your host, where you have custom *.ini files.
/var/mailMail mbox directory
⁠Default ports
DockerDescription
9000HHVM listening Port

⁠Usage

It is recommended to always use the $TIMEZONE variable which will set php's date.timezone.

1. Provide FPM port to host

$ docker run -i \
    -p 127.0.0.1:9000:9000 \
    -e TIMEZONE=Europe/Berlin \
    -t cytopia/hhvm-latest

2. Overwrite php.ini settings

Mount a PHP config directory from your host into the PHP docker in order to overwrite php.ini settings.

$ docker run -i \
    -v ~/.etc/php.d:/etc/php-custom.d \
    -p 127.0.0.1:9000:9000 \
    -e TIMEZONE=Europe/Berlin \
    -t cytopia/hhvm-latest

3. MySQL connect via 127.0.0.1 (via port-forward)

Forward MySQL Port from 172.168.0.30 (or any other IP address/hostname) and Port 3306 to the PHP docker on 127.0.0.1:3306. By this, your PHP files inside the docker can use 127.0.0.1 to connect to a MySQL database.

$ docker run -i \
    -p 127.0.0.1:9000:9000 \
    -e TIMEZONE=Europe/Berlin \
    -e FORWARD_PORTS_TO_LOCALHOST='3306:172.168.0.30:3306' \
    -t cytopia/hhvm-latest

4. MySQL and Redis connect via 127.0.0.1 (via port-forward)

Forward MySQL Port from 172.168.0.30:3306 and Redis port from redis:6379 to the PHP docker on 127.0.0.1:3306 and 127.0.0.1:6379. By this, your PHP files inside the docker can use 127.0.0.1 to connect to a MySQL or Redis database.

$ docker run -i \
    -p 127.0.0.1:9000:9000 \
    -e TIMEZONE=Europe/Berlin \
    -e FORWARD_PORTS_TO_LOCALHOST='3306:172.168.0.30:3306, 6379:redis:6379' \
    -t cytopia/hhvm-latest

5. MySQL connect via localhost (via socket mount)

Mount a MySQL socket from ~/run/mysqld/mysqld.sock (on your host) into the PHP docker to /tmp/mysql/mysqld.sock. By this, your PHP files inside the docker can use localhost to connect to a MySQL database. In order to make php aware of new path of the mysql socket, we will also have to create a php config file and mount it into the container.

# Show local custom php config
$ cat ~/tmp/cfg/php/my-config.ini
mysql.default_socket = /tmp/mysql/mysqld.sock
mysqli.default_socket = /tmp/mysql/mysqld.sock
pdo_mysql.default_socket = /tmp/mysql/mysqld.sock

# Start container with mounted socket and config
$ docker run -i \
    -v ~/run/mysqld:/tmp/mysql \
    -v ~/tmp/cfg/php:/etc/php-custom.d \
    -p 127.0.0.1:9000:9000 \
    -e TIMEZONE=Europe/Berlin \
    -t cytopia/hhvm-latest

6. Launch Postfix for mail-catching

Once you $ENABLE_MAIL=1, all mails sent via any of your PHP applications no matter to which domain, are catched locally into the devilbox account. You can also mount the mail directory locally to hook in with mutt and read those mails.

$ docker run -i \
    -p 127.0.0.1:9000:9000 \
    -v /tmp/mail:/var/mail \
    -e TIMEZONE=Europe/Berlin \
    -e ENABLE_MAIL=1 \
    -t cytopia/hhvm-latest

7. Run with webserver that supports PHP-FPM

~/my-host-www will be the directory that serves the php files (your document root). Make sure to mount it into both, php and the webserver.

# Start myself
$ docker run -d \
    -p 9000 \
    -v ~/my-host-www:/var/www/html \
    --name php \
    -t cytopia/hhvm-latest

# Start webserver and link into myself
$ docker run -d \
    -p 80:80 \
    -v ~/my-host-www:/var/www/html \
    -e PHP_FPM_ENABLE=1 \
    -e PHP_FPM_SERVER_ADDR=php \
    -e PHP_FPM_SERVER_PORT=9000 \
    --link php \
    -t cytopia/nginx-mainline

⁠Modules

[Version]

HipHop VM 3.21.0 (rel)

[HHVM Modules]

apc, assert, bcmath, brotli, curl, date, highlight, hphp, imagick, intl, mbstring, memcache, memcached, mongodb, mysqli, pcre, session, xdebug, zend, zlib

[Tools]

[Misc Tools]

mongodump, mongoexport, mongofiles, mongoimport, mongooplog, mongoperf, mongorestore, mongostat, mongotop, mysql, mysqladmin, mysqlanalyze, mysqlcheck, mysql_config_editor, mysqldump, mysqldumpslow, mysql_embedded, mysqlimport, mysqloptimize, mysqlpump, mysqlrepair, mysqlreport, mysqlshow, mysqlslap, pg_basebackup, pg_dump, pg_dumpall, pg_isready, pg_receivewal, pg_receivexlog, pg_recvlogical, pg_restore, psql

Tag summary
Recent tags
Content type
Image
Digest
Size
528.1 MB
Last updated
about 9 years ago
docker pull cytopia/hhvm-latest:latest