Giter Club home page Giter Club logo

php's Introduction

PHP Docker Container Images

Build Status Docker Pulls Docker Stars

Table of Contents

Docker Images

❗For better reliability we release images with stability tags (wodby/php:8-X.X.X) which correspond to git tags. We strongly recommend using images only with stability tags.

About images:

Supported tags and respective Dockerfile links:

-dev

Images with -dev tag have a few differences:

  • sudo allowed for all commands for wodby user
  • PHP source code available under /usr/src/php.tar.xz
  • PHP_FPM_CLEAR_ENV is set to no by default
  • Additional packages installed: yarn

-dev-macos

Same as -dev but the default user/group wodby has uid/gid 501/20 to match the macOS default user/group ids.

Supported architectures

All images built for linux/amd64 and linux/arm64

Environment Variables

PHP and PHP-FPM configuration

The default configuration not recommended for use for production environment:

Variable 8.3 8.2 8.1
PHP_ALLOW_URL_FOPEN On On On
PHP_APCU_ENABLE_CLI 0 0 0
PHP_APCU_ENABLED 1 1 1
PHP_APCU_ENTRIES_HINT 4096 4096 4096
PHP_APCU_COREDUMP_UNMAP 0 0 0
PHP_APCU_GC_TTL 3600 3600 3600
PHP_APCU_PRELOAD_PATH NULL NULL NULL
PHP_APCU_SERIALIZER
PHP_APCU_SHM_SEGMENTS 1 1 1
PHP_APCU_SHM_SIZE 32M 32M 32M
PHP_APCU_SLAM_DEFENSE 1 1 1
PHP_APCU_TTL 0 0 0
PHP_APCU_USE_REQUEST_TIME 1 1 1
PHP_ASSERT_ACTIVE On On On
PHP_AUTO_PREPEND_FILE
PHP_AUTO_APPEND_FILE
PHP_BROTLI_OUTPUT_COMPRESSION 0 0 0
PHP_BROTLI_OUTPUT_COMPRESSION_LEVEL -1 -1 -1
PHP_CLI_MEMORY_LIMIT -1 -1 -1
PHP_DATE_TIMEZONE UTC UTC UTC
PHP_DEFAULT_SOCKET_TIMEOUT 60 60 60
PHP_DISPLAY_ERRORS On On On
PHP_DISPLAY_STARTUP_ERRORS On On On
PHP_ERROR_REPORTING E_ALL E_ALL E_ALL
PHP_EXPOSE Off Off Off
PHP_EXTENSIONS_DISABLE xdebug,xhprof,spx xdebug,xhprof,spx xdebug,xhprof,spx
PHP_FPM_CLEAR_ENV yes yes yes
PHP_FPM_ENV_VARS
PHP_FPM_LOG_LEVEL notice notice notice
PHP_FPM_PM dynamic dynamic dynamic
PHP_FPM_PM_MAX_CHILDREN 8 8 8
PHP_FPM_PM_MAX_REQUESTS 500 500 500
PHP_FPM_PM_MAX_SPARE_SERVERS 3 3 3
PHP_FPM_PM_MIN_SPARE_SERVERS 1 1 1
PHP_FPM_PM_STATUS_PATH
PHP_FPM_REQUEST_SLOWLOG_TIMEOUT
PHP_FPM_PM_START_SERVERS 2 2 2
PHP_FPM_USER www-data www-data www-data
PHP_FPM_GROUP www-data www-data www-data
PHP_GRPC_ENABLE_FORK_SUPPORT 1 1 1
PHP_GRPC_LOG_FILENAME /proc/self/fd/2 /proc/self/fd/2 /proc/self/fd/2
PHP_GRPC_POLL_STRATEGY epoll1 epoll1 epoll1
PHP_GRPC_TRACE
PHP_GRPC_VERBOSITY error error error
PHP_IGBINARY_COMPACT_STRINGS On On On
PHP_LOG_ERRORS On On On
PHP_LOG_ERRORS_MAX_LEN 0 0 0
PHP_MAX_EXECUTION_TIME 120 120 120
PHP_MAX_FILE_UPLOADS 20 20 20
PHP_MAX_INPUT_TIME 60 60 60
PHP_MAX_INPUT_VARS 2000 2000 2000
PHP_MEMORY_LIMIT 512M 512M 512M
PHP_MYSQLI_CACHE_SIZE 2000 2000 2000
PHP_NEWRELIC_LICENSE
see all newrelic ext options 8.x newrelic 8.x newrelic 8.x newrelic
PHP_OPCACHE_ENABLE 1 1 1
PHP_OPCACHE_ENABLE_CLI 0 0 0
PHP_OPCACHE_VALIDATE_TIMESTAMPS 1 1 1
PHP_OPCACHE_REVALIDATE_FREQ 2 2 2
PHP_OPCACHE_MAX_ACCELERATED_FILES 4000 4000 4000
PHP_OPCACHE_MEMORY_CONSUMPTION 128 128 128
PHP_OPCACHE_INTERNED_STRINGS_BUFFER 8 8 8
PHP_OPCACHE_FAST_SHUTDOWN - - -
PHP_OPCACHE_HUGE_CODE_PAGES 0 0 0
PHP_OPCACHE_PRELOAD - - -
PHP_OPCACHE_PRELOAD_USER www-data www-data www-data
PHP_OPCACHE_JIT tracing tracing tracing
PHP_OPCACHE_JIT_BUFFER_SIZE 0 0 0
PHP_OUTPUT_BUFFERING 4096 4096 4096
PHP_PCOV_ENABLED 0 0 0
see all pcov ext options 8.x pcov 8.x pcov 8.x pcov
PHP_PDO_MYSQL_CACHE_SIZE - - -
PHP_PHAR_READONLY 1 1 1
PHP_PHAR_REQUIRE_HASH 1 1 1
PHP_PHAR_CACHE_LIST
PHP_POST_MAX_SIZE 32M 32M 32M
PHP_REALPATH_CACHE_SIZE 4096k 4096k 4096k
PHP_REALPATH_CACHE_TTL 120 120 120
PHP_SENDMAIL_PATH /usr/bin/msmtp -t -i /usr/bin/msmtp -t -i /usr/bin/dos2unix -u | /usr/bin/msmtp -t -i
PHP_MAIL_MIXED_LF_AND_CRLF Off Off -
PHP_SESSION_SAVE_HANDLER files files files
PHP_SHORT_OPEN_TAG 1 1 1
PHP_SPX_DATA_DIR /mnt/files/spx /mnt/files/spx /mnt/files/spx
PHP_SPX_HTTP_ENABLED 0 0 0
PHP_SPX_HTTP_KEY
PHP_SPX_HTTP_IP_WHITELIST
see all sqlsrv ext options 8.x sqlsrv 8.x sqlsrv 8.x sqlsrv
see all session options 8.3 session 8.2 session 8.1 session
see all xhprof options 8.x xhprof 8.x xhprof 8.x xhprof
PHP_UPLOAD_MAX_FILESIZE 32M 32M 32M
PHP_XDEBUG_MODE off off off
see all xdebug ext options 8.x xdebug 8.x xdebug 8.x xdebug
PHP_ZEND_ASSERTIONS 1 1 1

"-" - Not available for this version

Additional configuration

Variable Default value
GIT_USER_EMAIL [email protected]
GIT_USER_NAME wodby
HTTP_PROXY
SSH_PRIVATE_KEY
SSH_DISABLE_STRICT_KEY_CHECKING
SSHD_GATEWAY_PORTS no
SSHD_HOST_KEYS_DIR /etc/ssh
SSHD_LOG_LEVEL INFO
SSHD_PASSWORD_AUTHENTICATION no
SSHD_PERMIT_USER_ENV yes
SSHD_USE_DNS yes
SSMTP_MAILHUB opensmtpd:25
SSMTP_FROM_LINE_OVERRIDE Yes
SSMTP_USE_TLS No
MSMTP_PORT 25
MSMTP_TLS off
MSMTP_LOG
MSMTP_LOGFILE /proc/self/fd/2
MSMTP_AUTH off
MSMTP_HOST opensmtpd
MSMTP_ADD_MISSING_DATE_HEADER on

Build arguments

Argument Default value
PHP_VER
PHP_DEV
WODBY_GROUP_ID 1000
WODBY_USER_ID 1000

Change WODBY_USER_ID and WODBY_GROUP_ID mainly for local dev version of images, if it matches with existing system user/group ids the latter will be deleted.

PHP Extensions

Extensions xdebug, xhprof and spx disabled by default, to change it override the default env var PHP_EXTENSIONS_DISABLE=xdebug,xhprof,spx.

Extension 8.3 8.2 8.1
amqp 2.1.1 2.1.1 2.1.1
apcu 5.1.23 5.1.23 5.1.23
ast 1.1.1 1.1.1 1.1.1
bcmath
brotli 0.14.2 0.14.2 0.14.2
bz2
calendar
Core
ctype
curl
date
dom
ds 1.5.0 1.5.0 1.5.0
exif
event 3.0.8 3.0.8 3.0.8
fileinfo
filter
ftp - -
gd
grpc 1.60.0 1.60.0 1.60.0
hash
iconv
igbinary 3.2.15 3.2.15 3.2.15
imagick master 3.7.0 3.7.0
imap
intl
json
ldap
libxml
mbstring
memcached 3.2.0 3.2.0 3.2.0
mongodb 1.17.1 1.17.1 1.17.1
mysqli
mysqlnd
newrelic latest latest latest
OAuth 2.0.7 2.0.7 2.0.7
openssl
opentelemetry 1.0.0 1.0.0 1.0.0
pcov latest latest latest
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv* 5.11.1 5.11.1 5.11.1
pgsql
Phar
posix
rdkafka 6.0.3 6.0.3 6.0.3
readline
redis 6.0.2 6.0.2 6.0.2
Reflection
session
SimpleXML
smbclient 1.1.1 1.1.1 1.1.1
soap
sockets
sodium
SPL
spx 0.4.15 0.4.15 0.4.15
sqlite3
sqlsrv* 5.11.1 5.11.1 5.11.1
standard
tidy
tokenizer
uploadprogress 2.0.2 2.0.2 2.0.2
uuid 1.2.0 1.2.0 1.2.0
xdebug 3.3.2 3.3.2 3.3.2
xhprof 2.3.9 2.3.9 2.3.9
xml
xmlreader
xmlwriter
xsl
yaml 2.2.3 2.2.3 2.2.3
Zend OPcache
zip
zlib

Legend:

  • [EMPTY] – Core PHP extension
  • "-" - Not exists in this version > Some extensions may not be available in -dev images
  • sqlsrv extension has no arm64 support because the driver has no support for linux/arm64

Tools

Tool 8.3 8.2 8.1
Composer latest latest latest

Xdebug

By default, xdebug mode set to off, which has close to 0 overhead. If you want to disable the extension completely set PHP_EXTENSIONS_DISABLE=xdebug.

Changelog

Changes per stability tag reflected in git tags description under releases.

Crond

You can run Crond with this image changing the command to sudo -E crond -f -d 0 and mounting a crontab file to ./crontab:/etc/crontabs/www-data. Example crontab file contents:

# min	hour	day	month	weekday	command
*/1	*	*	*	*	echo "test" > /mnt/files/cron

SSHD

You can run SSHD with this image by changing the command to sudo /usr/sbin/sshd -De and mounting authorized public keys to /home/wodby/.ssh/authorized_keys

Adding SSH key

You can add a private SSH key to the container by mounting it to /home/wodby/.ssh/id_rsa

Users and permissions

Default container user is wodby:wodby (UID/GID 1000). PHP-FPM runs from www-data:www-data user (UID/GID 82) by default. User wodby is a part of www-data group.

Codebase volume $APP_ROOT (/var/www/html) owned by wodby:wodby. Files volume $FILES_DIR (/mnt/files) owned by www-data:www-data with 775 mode.

See #22 for more details.

Helper scripts

  • files_chmod – in case you need write access for wodby user to a file/dir generated by www-data on this volume run sudo files_chmod [FILEPATH] script (FILEPATH must be under /mnt/files), it will recursively change the mode to ug=rwX,o=rX

  • files_chown – in case you manually uploaded files under wodby user to files volume and want to change the ownership of those files to www-data run sudo files_chown [FILEPATH] script (FILEPATH must be under /mnt/files), it will recursively change ownership to www-data:www-data

Complete PHP-based stacks

Images based on wodby/php

Orchestration Actions

Usage:

make COMMAND [params ...]

commands:
    migrate
    check-ready [host max_try wait_seconds delay_seconds]
    git-clone url [branch]
    git-checkout target [is_hash]   
    files-import source
    files-link public_dir 
    update-keys
    walter

default params values:
    is_hash 0
    branch "" Branch, tag or hash commit

php's People

Contributors

alsar avatar cbccharlie avatar codebymikey avatar csandanov avatar guiajlopes avatar imyaro avatar ivegas avatar mcrump001 avatar niklan avatar omarlopesino avatar pprishchepa avatar rodrigoaguilera avatar spleshka avatar virtuman avatar wodbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php's Issues

Add sqlsrv & pdo_sqlsrv extension for connecting to MSSQL Database

Hi,

I was wondering if it would be possible to add sqlsrv & pdo_sqlsrv extension to the container so it will work out of the box to connect to MSSQL Databases.

I've been trying to set this up myself but no success :)
Or maybe someone with more experience could point me in the right direction.

I though I could do this :

FROM wodby/php:7.2-4.9.0

USER root

RUN pecl install sqlsrv \
    && docker-php-ext-enable sqlsrv

RUN pecl install pdo_sqlsrv \
    && docker-php-ext-enable pdo_sqlsrv

RUN echo "extension= pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`\
RUN echo "extension= sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` \

Do not use www-data as default user

  1. In version 2.x of this image we had root as the default user
  2. Quickly we realized that it's not good (drush and composer don't like to be run from root) and changed it to www-data. User www-data (uid/gid 82) is a de-facto standard in Alpine Linux for php-fpm, nginx, apache packages, something similar to www-data in Debian/Ubuntu
  3. PR #18 was posted making a good point that fpm and HTTP server shouldn't have write access to user's files (codebase), as the result we changed fpm user to php-fpm (1000) in 3.5.0
  4. Now, we realized that the way we use www-data is completely wrong, it's a standard system user that comes with a "package" similar to www-data in Debian/Ubuntu that should be used only to run a package daemon, so it's not a usual Linux user and should not be used to log in and manage files
  5. Based on 4 we decided to release 4.x version of stack where we add a new default user wodby with uid/gid 1000 to match user in most Linux distributions. PHP-FPM will run via sudo with FPM user/group set to www-data (82). User wodby will be a part of www-data group.

Feb 16th UPDATED: wodby added to www-data group

Add env var to choose PHP FPM process manager

I'm proposing adding an environment variable that lets you choose the process manager used by PHP FPM. It is set to dynamic in the zz-www.conf.tpl file. It would be nice to have an environment variable that defaults to dynamic, but lets you change it to ondemand or static if wanted.

This article I found states that ondemand can be better in some situations. I noticed a significant memory consumption decrease when I switched to ondemand.

If this added, another environment variable should be included that lets the user set pm.process_idle_timeout.

Bash is missing from PATH

Therefore the following shebang is not working in containers:

#!/usr/bin/env bash

Proposed solution: symlink /bin/bash to /usr/bin/bash.

Image version: wodby/drupal-php:7.1-dev-4.2.2, but I assume the problem relies in this base image.

Why we dropped PHP 7.0

The issue

We've identified the issue with PHP's mail function when sent to multiple recipients in busybox (Alpine 3.7) http://lists.busybox.net/pipermail/busybox/2017-August/085798.html. As the solution we upgraded all PHP images to the latest stable Alpine 3.8 with an updated busybox, however PHP 7.0 build fails with SSL errors docker-library/php#702 (comment)

Why drop?

Considering this issue and PHP 7.0's current state in "security fixes only" with EOL in 2 months, as well as there, are no significant barriers for upgrading to PHP 7.1 (compared to 5.x > 7.x) we decided to drop PHP 7.0

Controlling allow_url_fopen value

I'd like to know if there any possibility turn off allow_url_fopen in my setup. We have some security constrains in our server and we have to follow this security instructions.

Add option phar.readonly to php.ini

Could you please add this option to the various php.ini files:

phar.readonly = {{ getenv "PHP_PHAR_READONLY" "1" }}

We could then change that to 0 (zero) when we have an application that needs to write to a phar file.

Include GD extension

Hello there,

I'm trying to crop an image to use with the 2017 theme but I get the following error.

There has been an error cropping your image.

As simple google search "wordpress There has been an error cropping your image." reveals that the GD extension is required to be installed for vanilla WP to be able to crop images.
https://wordpress.org/support/topic/there-has-been-an-error-cropping-your-image-4/

Also a quick look in the official WP dockerfile it reveals that the GD extension is installed by default.
https://github.com/docker-library/wordpress/blob/050652ba972ba46d24cb1b2174a2c4c9fbbbcd80/php7.1/fpm-alpine/Dockerfile#L18

Any chance you could update your Dockerfile to include the GD extension?

Many thanks in advance,
Angel

XDebug remains always enabled

I am using the tag wodby/drupal-php:7.1-dev-4.2.2. A portion of docker-compose.yml looks like:

  php:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      DB_HOST: $DB_HOST
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      DB_DRIVER: $DB_DRIVER
      PHP_XDEBUG: $PHP_XDEBUG_ENABLED
    volumes:
      - ./:/var/www/html

PHP_XDEBUG_ENABLED is set to 0. However, the container is started with xdebug enabled.

I am using this stack inside our CI. We need xdebug disabled when Drupal is installed, but need it enabled while running the tests, for code coverage. Therefore, we are controlling it using a PHP_XDEBUG_ENABLED shell variable.

What would be the best way to handle this situation?

Composer cache

Cannot create cache directory /.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache

Composer without cache very slow!

Why is there SSHd in this container?

When I docker exec into the php container, I see that that sshd exists inside the container. That seems to be against best practices. If ssh was needed, it should be handled by the host or as a seperate container for the process.

Option to suppress `docker-entrypoint.sh` output

Some of our local environment tooling works by running docker exec on Drupal PHP containers and doing something with the output. The main usecase is automatically opening the like that drush uli outputs.

But the output from https://github.com/wodby/php/blob/master/7.1/docker-entrypoint.sh#L18 gets in the way of this since on wodby/drupal-php it outputs this:

/docker-entrypoint.sh: running /docker-entrypoint-init.d/10-drupal-php.sh

I would like to propose that this line is suppressed unless the DEBUG environment variable is set.

Adding PHP extension : php_rdkafka

Hello!

I publish an issue to know if it possibles to add php-rdkafka extension to drupal-php image? I tried on my own without success. If we can add this on the main image, I will be very grateful.

PHP Version : 7.1
ext-rdkafka wanted : 3.0 at least

Thanks a lot!

gnupg keys import fails

gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: connecting dirmngr at '/root/.gnupg/S.dirmngr' failed: IPC connect call failed
gpg: keyserver receive failed: No dirmngr

Caused by using 3.8 and edge packages together, edge packages are deps of imagemagick https://bugs.alpinelinux.org/issues/9190 alpinelinux/aports#5402

Add support for Phalcon

I believe we can as well add support for Phalcon as php extension

In the meantime here is Dockerfile solution:

ARG PHP_TAG_ROW

FROM wodby/php:${PHP_TAG_ROW}
USER root
RUN mkdir -p /usr/src/php/ext && \
    curl -L -o /usr/src/php/ext/phalcon.tar.gz https://github.com/phalcon/cphalcon/archive/v3.3.1.tar.gz && \
    tar xzf /usr/src/php/ext/phalcon.tar.gz -C /usr/src/php/ext && \
    rm /usr/src/php/ext/phalcon.tar.gz && \
    mv /usr/src/php/ext/cphalcon-3.3.1 /usr/src/php/ext/phalcon

RUN docker-php-ext-install -j$(nproc) /usr/src/php/ext/phalcon/build/php7/64bits

How to run the CROND mode?

I've added the CRONTAB env var in my docker-compose file but nothing happens (/etc/crontabs/www-data
file is empty ).

i tried to clone the php service with the crontab env var and set

command: 
     - "sudo"
     - "-E"
     - "crond"

to pass this cmd arguments to the entrypoint script because i can read this:

elif [[ "${@:1:3}" == "sudo -E crond" ]]; then

but in this case the service start and stop immediately without errors.

any hint?

Add environment variable for opcache.validate_timestamps

It would be nice if opcache.validate_timestamps could be set to 0 through an environment variable, which can be usefull to speed up (automated) acceptance testing environments, where source code is not changed anymore once built.

Question: Why is /usr/src/php.tar.xz removed?

We were trying to install the mbstring extension to this image (this is for a drupal project). However we're unable to install any extensions because those directories have been removed.

How come this directory has been removed? Also, do you have a solution for adding extensions easier rather than having to copy this docker file and then have drupal one extend that?

Thanks for the work so far :)

what is the purpose of geoip module in PHP and NGINX images?

It looks like geoip is being installed and activated, but it isn't really usable until the database files are loaded and proper nginx headers are passed to proxy or fastcgi backend.

Is there a way that this was intended to be used or

Example for geoip:
Download database:
https://github.com/lalamove/docker-nginx-php7/blob/master/Dockerfile#L190
Include in nginx.conf:
https://github.com/lalamove/docker-nginx-php7/blob/master/nginx_log_format.conf#L2
Append fastcgi or proxy headers:
https://github.com/lalamove/docker-nginx-php7/blob/master/nginx_geoip_params

Example for geoip2:
Download databases:
https://github.com/crazy-max/docker-matomo/blob/master/Dockerfile#L77
Include in nginx.conf and define parameters:
https://github.com/crazy-max/docker-matomo/blob/master/assets/tpls/etc/nginx/nginx.conf#L9
Append fastcgi headers:
https://github.com/crazy-max/docker-matomo/blob/master/assets/tpls/etc/nginx/nginx.conf#L123

PHP geoip support
Same goes for php - since it doesn't define location of maxMind's database, it will generate php warning: like this one:
Warning: geoip_country_code_by_name(): Required database not available at /GeoIP.dat. in /var/www/html/geo.php on line 1

docker-entrypoint.sh: line 96: exec_init_scripts: command not found

After running docker-compose up php

I get docker-entrypoint.sh: line 96: exec_init_scripts: command not found

This is the docker-compose file:

version: "2.0"
services:
  php:
    build:
      context: https://github.com/wodby/php.git#:7
      args:
        - FROM_TAG=7.1.14
        - WODBY_USER_ID=107
        - WODBY_GROUP_ID=111
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      DB_HOST: $DB_HOST
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      DB_DRIVER: $DB_DRIVER
    volumes:
      - ./:/var/www/html

What am I doing wrong?
Thanks!

Docker compose unsatisfiable constraints: jpegoptim (missing)

I'm trying to build this image from GIT repository with docker compose this way:

version: "2"

  services:

    php7:
      build:
        context: https://github.com/wodby/php.git#:7
        args:
          - FROM_TAG=7.1
          - WODBY_USER_ID=107
          - WODBY_GROUP_ID=111
      environment: []
      volumes:
        - ./:/var/www/html

Command:
docker-compose up --build -d

But I get:

Building php7
Step 1/17 : ARG FROM_TAG
Step 2/17 : FROM wodby/base-php:${FROM_TAG}
 ---> c44f90546d7c
Step 3/17 : ARG PHP_DEV
 ---> Using cache
 ---> 2b4a57e79be0
Step 4/17 : ARG PHP_DEBUG
 ---> Using cache
 ---> 57eeb79532cd
Step 5/17 : ARG WODBY_USER_ID=1000
 ---> Using cache
 ---> 10bea25438e1
Step 6/17 : ARG WODBY_GROUP_ID=1000
 ---> Using cache
 ---> 009d43f814a1
Step 7/17 : ENV PHP_DEV="${PHP_DEV}"     PHP_DEBUG="${PHP_DEBUG}"     SSHD_PERMIT_USER_ENV="yes"     PHP_PRESTISSIMO_VER="0.3"     WALTER_VER="1.3.0"         EXT_AMQP_VER="1.9.3"     EXT_APCU_VER="5.1.11"     EXT_AST_VER="0.1.6"     EXT_DS_VER="1.2.4"     EXT_GEOIP_VER="1.1.1"     EXT_GRPC_VER="1.10.0"     EXT_IGBINARY_VER="2.0.5"     EXT_IMAGICK_VER="3.4.3"     EXT_MEMCACHED_VER="3.0.4"     EXT_MONGODB_VER="1.4.0"     EXT_OAUTH_VER="2.0.2"     EXT_REDIS_VER="3.1.6"     EXT_XDEBUG_VER="2.6.0"     EXT_YAML_VER="2.0.2"         PHP72_EXT_MCRYPT_VER="1.0.1"         C_CLIENT_VER="2007f-r7"     FREETYPE_VER="2.8.1-r2"     GEOIP_VER="1.6.11-r0"     GMP_VER="6.1.2-r1"     ICU_LIBS_VER="59.1-r1"     IMAGEMAGICK_VER="7.0.7.11-r1"     JPEGOPTIM_VER="1.4.4-r0"     LIBBZ2_VER="1.0.6-r6"     LIBJPEG_TURBO_VER="1.5.2-r0"     LIBLDAP_VER="2.4.45-r3"     LIBLTDL_VER="2.4.6-r4"     LIBMEMCACHED_LIBS_VER="1.0.18-r2"     LIBMCRYPT_VER="2.5.8-r7"     LIBPNG_VER="1.6.34-r1"     LIBXSLT_VER="1.1.31-r0"     MARIADB_CLIENT_VER="10.1.32-r0"     POSTGRESQL_CLIENT_VER="10.4-r0"     RABBITMQ_C_VER="0.8.0-r3"     YAML_VER="0.1.7-r0"         LD_PRELOAD="/usr/lib/preloadable_libiconv.so php"
 ---> Using cache
 ---> d365d03fd529
Step 8/17 : ENV APP_ROOT="/var/www/html"     CONF_DIR="/var/www/conf"     FILES_DIR="/mnt/files"     PATH="${PATH}:/home/wodby/.composer/vendor/bin"     SSHD_HOST_KEYS_DIR="/etc/ssh"     ENV="/home/wodby/.shrc"         GIT_USER_EMAIL="[email protected]"     GIT_USER_NAME="wodby"
 ---> Using cache
 ---> ada36b3ffe68
Step 9/17 : RUN set -xe;         existing_group=$(getent group "${WODBY_GROUP_ID}" | cut -d: -f1);     if [[ -n "${existing_group}" ]]; then delgroup "${existing_group}"; fi;     existing_user=$(getent passwd "${WODBY_USER_ID}" | cut -d: -f1);     if [[ -n "${existing_user}" ]]; then deluser "${existing_user}"; fi;     	addgroup -g "${WODBY_GROUP_ID}" -S wodby; 	adduser -u "${WODBY_USER_ID}" -D -S -s /bin/bash -G wodby wodby; 	adduser wodby www-data; 	sed -i '/^wodby/s/!/*/' /etc/shadow;         apk add --update --no-cache -t .php-rundeps         "c-client=${C_CLIENT_VER}"         fcgi         findutils         "freetype=${FREETYPE_VER}"         "geoip=${GEOIP_VER}"         git         "gmp=${GMP_VER}"         "icu-libs=${ICU_LIBS_VER}"         "imagemagick=${IMAGEMAGICK_VER}"         "jpegoptim=${JPEGOPTIM_VER}"         less         "libbz2=${LIBBZ2_VER}"         "libjpeg-turbo=${LIBJPEG_TURBO_VER}"         "libjpeg-turbo-utils=${LIBJPEG_TURBO_VER}"         "libldap=${LIBLDAP_VER}"         "libltdl=${LIBLTDL_VER}"         "libmemcached-libs=${LIBMEMCACHED_LIBS_VER}"         "libmcrypt=${LIBMCRYPT_VER}"         "libpng=${LIBPNG_VER}"         "libxslt=${LIBXSLT_VER}"         make         "mariadb-client=${MARIADB_CLIENT_VER}"         nano         openssh         openssh-client         patch         "postgresql-client=${POSTGRESQL_CLIENT_VER}"         "rabbitmq-c=${RABBITMQ_C_VER}"         rsync         su-exec         sudo         tig         tmux         "yaml=${YAML_VER}";         apk add --update --no-cache -t .build-deps         autoconf         cmake         build-base         bzip2-dev         freetype-dev         geoip-dev         gmp-dev         icu-dev         imagemagick-dev         imap-dev         jpeg-dev         libjpeg-turbo-dev         libmemcached-dev         libmcrypt-dev         libpng-dev         libtool         libxslt-dev         openldap-dev         pcre-dev         postgresql-dev         rabbitmq-c-dev         yaml-dev;         apk add -U -X http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted gnu-libiconv;         apk add --update --no-cache redis;     mkdir -p /tmp/pkgs-bins;     mv /usr/bin/redis-cli /tmp/;     apk del --purge redis;     deluser redis;     mv /tmp/redis-cli /usr/bin;         docker-php-source extract;         docker-php-ext-install         bcmath         bz2         calendar         exif         gmp         imap         intl         ldap         mysqli         opcache         pcntl         pdo_mysql         pdo_pgsql         pgsql         soap         sockets         xmlrpc         xsl         zip;         docker-php-ext-configure gd         --with-gd         --with-freetype-dir=/usr/include/         --with-png-dir=/usr/include/         --with-jpeg-dir=/usr/include/;       NPROC=$(getconf _NPROCESSORS_ONLN);       docker-php-ext-install "-j${NPROC}" gd;         pecl config-set php_ini "${PHP_INI_DIR}/php.ini";         if [[ "${PHP_VERSION:0:3}" == "7.2" ]]; then         pecl install mcrypt-${PHP72_EXT_MCRYPT_VER};         docker-php-ext-enable mcrypt;     else         docker-php-ext-install mcrypt;     fi;         newrelic_url="http://download.newrelic.com/php_agent/release/";     wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1;     tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic;     export NR_INSTALL_SILENT=true;     export NR_INSTALL_USE_CP_NOT_LN=true;     bash /tmp/newrelic/newrelic-install install;     rm /usr/local/etc/php/conf.d/newrelic.ini;     mkdir -p /var/log/newrelic/;     chown -R www-data:www-data /var/log/newrelic/;     chmod -R 775 /var/log/newrelic/;         pecl install         "amqp-${EXT_AMQP_VER}"         "apcu-${EXT_APCU_VER}"         "ast-${EXT_AST_VER}"         "ds-${EXT_DS_VER}"         "geoip-${EXT_GEOIP_VER}"         "grpc-${EXT_GRPC_VER}"         "igbinary-${EXT_IGBINARY_VER}"         "imagick-${EXT_IMAGICK_VER}"         "memcached-${EXT_MEMCACHED_VER}"         "mongodb-${EXT_MONGODB_VER}"         "oauth-${EXT_OAUTH_VER}"         "redis-${EXT_REDIS_VER}"         "xdebug-${EXT_XDEBUG_VER}"         "yaml-${EXT_YAML_VER}";         docker-php-ext-enable         amqp         apcu         ast         ds         igbinary         imagick         geoip         grpc         memcached         mongodb         oauth         redis         xdebug         yaml;         mkdir -p /tmp/blackfire;     version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;");     blackfire_url="https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/${version}";     wget -qO- "${blackfire_url}" | tar xz --no-same-owner -C /tmp/blackfire;     mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so;         mkdir -p /usr/src/php/ext/uploadprogress;     up_url="https://github.com/wodby/pecl-php-uploadprogress/archive/latest.tar.gz";     wget -qO- "${up_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/uploadprogress;     docker-php-ext-install uploadprogress;         wget -qO- https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;         su-exec wodby composer global require "hirak/prestissimo:^${PHP_PRESTISSIMO_VER}";         walter_url="https://github.com/walter-cd/walter/releases/download/v${WALTER_VER}/walter_${WALTER_VER}_linux_amd64.tar.gz";     wget -qO- "${walter_url}" | tar xz -C /tmp/;     mv /tmp/walter_linux_amd64/walter /usr/local/bin;         {         echo 'export PS1="\u@${WODBY_APP_NAME:-php}.${WODBY_ENVIRONMENT_NAME:-container}:\w $ "';         echo "export PATH=${PATH}";     } | tee /home/wodby/.shrc;         cp /home/wodby/.shrc /home/wodby/.bashrc;         {         echo 'Defaults env_keep += "APP_ROOT FILES_DIR"' ;                 if [[ -n "${PHP_DEV}" ]]; then             echo 'wodby ALL=(root) NOPASSWD:SETENV:ALL';         else             echo -n 'wodby ALL=(root) NOPASSWD:SETENV: ' ;             echo -n '/usr/local/bin/files_chmod, ' ;             echo -n '/usr/local/bin/files_chown, ' ;             echo -n '/usr/local/bin/files_sync, ' ;             echo -n '/usr/local/bin/gen_ssh_keys, ' ;             echo -n '/usr/local/bin/init_volumes, ' ;             echo -n '/usr/local/bin/migrate, ' ;             echo -n '/usr/local/sbin/php-fpm, ' ;             echo -n '/usr/sbin/sshd, ' ;             echo '/usr/sbin/crond' ;         fi;     } | tee /etc/sudoers.d/wodby;         echo "TLS_CACERTDIR /etc/ssl/certs/" >> /etc/openldap/ldap.conf;         mkdir -p         "${APP_ROOT}"         "${CONF_DIR}"         "${FILES_DIR}/public"         "${FILES_DIR}/private"         "${FILES_DIR}/xdebug/traces"         "${FILES_DIR}/xdebug/profiler"         /home/wodby/.ssh         /home/www-data/.ssh;         chmod -R 775 "${FILES_DIR}";     chown -R www-data:www-data "${FILES_DIR}" /home/www-data/.ssh;     chown -R wodby:wodby         "${APP_ROOT}"         "${CONF_DIR}"         "${PHP_INI_DIR}/conf.d"         /usr/local/etc/php-fpm.d/         /home/wodby/;         touch /etc/ssh/sshd_config;     chown wodby: /etc/ssh/sshd_config;         rm /etc/crontabs/root;     touch /etc/crontabs/www-data;     chown root:www-data /etc/crontabs/www-data;     chmod 660 /etc/crontabs/www-data;         su-exec wodby composer clear-cache;     docker-php-source delete;     apk del --purge .build-deps;     pecl clear-cache;         rm -rf         /usr/src/php/ext/ast         /usr/src/php/ext/uploadprogress         /usr/include/php         /usr/lib/php/build         /tmp/*         /root/.composer         /var/cache/apk/*;         if [[ -z "${PHP_DEV}" ]]; then         rm -rf /usr/src/php.tar.xz;     fi
 ---> Running in eb6440044c42
+ getent group 111
+ cut -d: -f1
+ existing_group=
+ [[ -n  ]]
+ getent passwd 107
+ cut -d: -f1
+ existing_user=
+ [[ -n  ]]
+ addgroup -g 111 -S wodby
+ adduser -u 107 -D -S -s /bin/bash -G wodby wodby
+ adduser wodby www-data
+ sed -i /^wodby/s/!/*/ /etc/shadow
+ apk add --update --no-cache -t .php-rundeps c-client=2007f-r7 fcgi findutils freetype=2.8.1-r2 geoip=1.6.11-r0 git gmp=6.1.2-r1 icu-libs=59.1-r1 imagemagick=7.0.7.11-r1 jpegoptim=1.4.4-r0 less libbz2=1.0.6-r6 libjpeg-turbo=1.5.2-r0 libjpeg-turbo-utils=1.5.2-r0 libldap=2.4.45-r3 libltdl=2.4.6-r4 libmemcached-libs=1.0.18-r2 libmcrypt=2.5.8-r7 libpng=1.6.34-r1 libxslt=1.1.31-r0 make mariadb-client=10.1.32-r0 nano openssh openssh-client patch postgresql-client=10.4-r0 rabbitmq-c=0.8.0-r3 rsync su-exec sudo tig tmux yaml=0.1.7-r0
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  jpegoptim (missing):
    required by:
ERROR: Service 'php7' failed to build: The command '/bin/sh -c set -xe;         existing_group=$(getent group "${WODBY_GROUP_ID}" | cut -d: -f1);     if [[ -n "${existing_group}" ]]; then delgroup "${existing_group}"; fi;     existing_user=$(getent passwd "${WODBY_USER_ID}" | cut -d: -f1);     if [[ -n "${existing_user}" ]]; then deluser "${existing_user}"; fi;     	addgroup -g "${WODBY_GROUP_ID}" -S wodby; 	adduser -u "${WODBY_USER_ID}" -D -S -s /bin/bash -G wodby wodby; 	adduser wodby www-data; 	sed -i '/^wodby/s/!/*/' /etc/shadow;         apk add --update --no-cache -t .php-rundeps         "c-client=${C_CLIENT_VER}"         fcgi         findutils         "freetype=${FREETYPE_VER}"         "geoip=${GEOIP_VER}"         git         "gmp=${GMP_VER}"         "icu-libs=${ICU_LIBS_VER}"         "imagemagick=${IMAGEMAGICK_VER}"         "jpegoptim=${JPEGOPTIM_VER}"         less         "libbz2=${LIBBZ2_VER}"         "libjpeg-turbo=${LIBJPEG_TURBO_VER}"         "libjpeg-turbo-utils=${LIBJPEG_TURBO_VER}"         "libldap=${LIBLDAP_VER}"         "libltdl=${LIBLTDL_VER}"         "libmemcached-libs=${LIBMEMCACHED_LIBS_VER}"         "libmcrypt=${LIBMCRYPT_VER}"         "libpng=${LIBPNG_VER}"         "libxslt=${LIBXSLT_VER}"         make         "mariadb-client=${MARIADB_CLIENT_VER}"         nano         openssh         openssh-client         patch         "postgresql-client=${POSTGRESQL_CLIENT_VER}"         "rabbitmq-c=${RABBITMQ_C_VER}"         rsync         su-exec         sudo         tig         tmux         "yaml=${YAML_VER}";         apk add --update --no-cache -t .build-deps         autoconf         cmake         build-base         bzip2-dev         freetype-dev         geoip-dev         gmp-dev         icu-dev         imagemagick-dev         imap-dev         jpeg-dev         libjpeg-turbo-dev         libmemcached-dev         libmcrypt-dev         libpng-dev         libtool         libxslt-dev         openldap-dev         pcre-dev         postgresql-dev         rabbitmq-c-dev         yaml-dev;         apk add -U -X http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted gnu-libiconv;         apk add --update --no-cache redis;     mkdir -p /tmp/pkgs-bins;     mv /usr/bin/redis-cli /tmp/;     apk del --purge redis;     deluser redis;     mv /tmp/redis-cli /usr/bin;         docker-php-source extract;         docker-php-ext-install         bcmath         bz2         calendar         exif         gmp         imap         intl         ldap         mysqli         opcache         pcntl         pdo_mysql         pdo_pgsql         pgsql         soap         sockets         xmlrpc         xsl         zip;         docker-php-ext-configure gd         --with-gd         --with-freetype-dir=/usr/include/         --with-png-dir=/usr/include/         --with-jpeg-dir=/usr/include/;       NPROC=$(getconf _NPROCESSORS_ONLN);       docker-php-ext-install "-j${NPROC}" gd;         pecl config-set php_ini "${PHP_INI_DIR}/php.ini";         if [[ "${PHP_VERSION:0:3}" == "7.2" ]]; then         pecl install mcrypt-${PHP72_EXT_MCRYPT_VER};         docker-php-ext-enable mcrypt;     else         docker-php-ext-install mcrypt;     fi;         newrelic_url="http://download.newrelic.com/php_agent/release/";     wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1;     tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic;     export NR_INSTALL_SILENT=true;     export NR_INSTALL_USE_CP_NOT_LN=true;     bash /tmp/newrelic/newrelic-install install;     rm /usr/local/etc/php/conf.d/newrelic.ini;     mkdir -p /var/log/newrelic/;     chown -R www-data:www-data /var/log/newrelic/;     chmod -R 775 /var/log/newrelic/;         pecl install         "amqp-${EXT_AMQP_VER}"         "apcu-${EXT_APCU_VER}"         "ast-${EXT_AST_VER}"         "ds-${EXT_DS_VER}"         "geoip-${EXT_GEOIP_VER}"         "grpc-${EXT_GRPC_VER}"         "igbinary-${EXT_IGBINARY_VER}"         "imagick-${EXT_IMAGICK_VER}"         "memcached-${EXT_MEMCACHED_VER}"         "mongodb-${EXT_MONGODB_VER}"         "oauth-${EXT_OAUTH_VER}"         "redis-${EXT_REDIS_VER}"         "xdebug-${EXT_XDEBUG_VER}"         "yaml-${EXT_YAML_VER}";         docker-php-ext-enable         amqp         apcu         ast         ds         igbinary         imagick         geoip         grpc         memcached         mongodb         oauth         redis         xdebug         yaml;         mkdir -p /tmp/blackfire;     version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;");     blackfire_url="https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/${version}";     wget -qO- "${blackfire_url}" | tar xz --no-same-owner -C /tmp/blackfire;     mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so;         mkdir -p /usr/src/php/ext/uploadprogress;     up_url="https://github.com/wodby/pecl-php-uploadprogress/archive/latest.tar.gz";     wget -qO- "${up_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/uploadprogress;     docker-php-ext-install uploadprogress;         wget -qO- https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;         su-exec wodby composer global require "hirak/prestissimo:^${PHP_PRESTISSIMO_VER}";         walter_url="https://github.com/walter-cd/walter/releases/download/v${WALTER_VER}/walter_${WALTER_VER}_linux_amd64.tar.gz";     wget -qO- "${walter_url}" | tar xz -C /tmp/;     mv /tmp/walter_linux_amd64/walter /usr/local/bin;         {         echo 'export PS1="\u@${WODBY_APP_NAME:-php}.${WODBY_ENVIRONMENT_NAME:-container}:\w $ "';         echo "export PATH=${PATH}";     } | tee /home/wodby/.shrc;         cp /home/wodby/.shrc /home/wodby/.bashrc;         {         echo 'Defaults env_keep += "APP_ROOT FILES_DIR"' ;                 if [[ -n "${PHP_DEV}" ]]; then             echo 'wodby ALL=(root) NOPASSWD:SETENV:ALL';         else             echo -n 'wodby ALL=(root) NOPASSWD:SETENV: ' ;             echo -n '/usr/local/bin/files_chmod, ' ;             echo -n '/usr/local/bin/files_chown, ' ;             echo -n '/usr/local/bin/files_sync, ' ;             echo -n '/usr/local/bin/gen_ssh_keys, ' ;             echo -n '/usr/local/bin/init_volumes, ' ;             echo -n '/usr/local/bin/migrate, ' ;             echo -n '/usr/local/sbin/php-fpm, ' ;             echo -n '/usr/sbin/sshd, ' ;             echo '/usr/sbin/crond' ;         fi;     } | tee /etc/sudoers.d/wodby;         echo "TLS_CACERTDIR /etc/ssl/certs/" >> /etc/openldap/ldap.conf;         mkdir -p         "${APP_ROOT}"         "${CONF_DIR}"         "${FILES_DIR}/public"         "${FILES_DIR}/private"         "${FILES_DIR}/xdebug/traces"         "${FILES_DIR}/xdebug/profiler"         /home/wodby/.ssh         /home/www-data/.ssh;         chmod -R 775 "${FILES_DIR}";     chown -R www-data:www-data "${FILES_DIR}" /home/www-data/.ssh;     chown -R wodby:wodby         "${APP_ROOT}"         "${CONF_DIR}"         "${PHP_INI_DIR}/conf.d"         /usr/local/etc/php-fpm.d/         /home/wodby/;         touch /etc/ssh/sshd_config;     chown wodby: /etc/ssh/sshd_config;         rm /etc/crontabs/root;     touch /etc/crontabs/www-data;     chown root:www-data /etc/crontabs/www-data;     chmod 660 /etc/crontabs/www-data;         su-exec wodby composer clear-cache;     docker-php-source delete;     apk del --purge .build-deps;     pecl clear-cache;         rm -rf         /usr/src/php/ext/ast         /usr/src/php/ext/uploadprogress         /usr/include/php         /usr/lib/php/build         /tmp/*         /root/.composer         /var/cache/apk/*;         if [[ -z "${PHP_DEV}" ]]; then         rm -rf /usr/src/php.tar.xz;     fi' returned a non-zero code: 25

What am I doing wrong? Thanks!

pcntl extension not installed

When using composer in a project with phpunit, this error appears
phpunit/php-invoker 1.1.4 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.

It would be much appreciated to add the pcntl extension if possible.

How to rebuild image with different uid/gid?

How to rebuild image with docker-composer.yml?

docker-compose.yml

  php:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      DB_HOST: $DB_HOST
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      DB_DRIVER: $DB_DRIVER
      WODBY_USER_ID: 1002
      WODBY_GROUP_ID: 1002

.env

# Linux (uid 1000 gid 1000)

WODBY_USER_ID=1002
WODBY_GROUP_ID=1002

#PHP_TAG=7.1-dev-4.6.0
#PHP_TAG=7.2-dev-4.6.0
#PHP_TAG=7.0-dev-4.6.0
PHP_TAG=5.6-dev-4.6.0
#PHP_TAG=5.3-dev-4.6.0

Add env var to set user/group for PHP process

If docker is used under a Windows Host with volumes, all files/directories inside the shared volumes are owned by "root" with the permission 0755. Currently, there is no way to change this behaviour or user (see docker/for-win#497 (comment)).

But the php process in the container runs with the default user/group "www-data". Basically it works, but if the webserver tries to save a file (e.g. a file upload) there is an access denied error. Because, only root is allowed to store files.

So, all Windows users need a solution to run the php process as root. See wodby/docker4drupal#29 (comment)

I think the best way to archive this is, to define new env vars for user and group. The Windows user can then set in his docker-compose the necessary user/group.

Example docker-compose.yml:

php:
  image: wodby/drupal-php:7.0-3.0.0
  environment:
    PHP_FPM_USER: root
    PHP_FPM_GROUP: root
  command: php-fpm --allow-to-run-as-root

New env vars:

  • PHP_FPM_USER
  • PHP_FPM_GROUP

new .gitconfig is made in webroot

I noticed in image: wodby/wordpress-php:7.0-4.2.4 a new file .gitconfig is added to my codebase.

[user]
        email = [email protected]
        name = wodby

I see the values in the Dockerfile

    GIT_USER_EMAIL="[email protected]" \
    GIT_USER_NAME="wodby"

Wondering why it is made when we have global settings and now have to add it to gitignore or provide variables to overwrite it. Each developer will have their own settings so it can not be added to a base config.

How to add custom SSH key

Hi, how can I add a custom ssh key into the www-data user? is that possible? I saw the environment var SSH_PRIVATE_KEY but I should not able to use it, could you give me an example?

ERROR: manifest for wodby/drupal-php:5.3-dev-3.3.1 not found

Codebase

mounted codebase

Host OS

macOS High Sierra

Docker info output

Containers: 6
Running: 1
Paused: 0
Stopped: 5
Images: 53
Server Version: 17.12.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.855GiB
Name: linuxkit-025000000001
ID: VCWZ:OBY3:MA3C:PEIG:WLPA:SVKG:MBAV:SLEC:62M7:Z6NR:VJ2B:DG2M
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 33
Goroutines: 48
System Time: 2018-01-25T14:51:24.640584582Z
EventsListeners: 2
HTTP Proxy:
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Docker compose file

version: "2"

services:
mariadb:
image: wodby/mariadb:10.1-2.1.0
ports:
- 45877:3306
environment:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
volumes:
- ./database:/var/lib/mysql # I want to manage volumes manually.
php:

image: wodby/drupal-php:5.3-2.1.0

image: wodby/drupal-php:5.3-dev-3.3.1

environment:
  PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
  PHP_FPM_CLEAR_ENV: "no"
  DB_DRIVER: mysql# PHP_MEMORY_LIMIT: 512M

volumes:
- ./docroot:/var/www/html

nginx:
image: wodby/drupal-nginx:8-1.10-2.1.0
depends_on:
- php
environment:
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html
volumes:
- ./public:/var/www/html

labels:
  - 'traefik.backend=nginx'
  - 'traefik.port=80'
  - 'traefik.frontend.rule=Host: cuk.internal, www.cuk.internal'
  - 'traefik.docker.network=cuk_default'

traefik:
image: traefik
command: -c /dev/null --web --docker --logLevel=INFO
ports:
- '8000:80'
volumes:
- /var/run/docker.sock:/var/run/docker.sock

Add graphicsmagick

Please, add graphicsmagick. It is better optimized. In some cases, Imagemagick takes all resources when using Image styles in Drupal. GM handles it ok.

docker run --user presents sudo prompt

Hi, thanks for all the work on maintaining the wodby images!

I'm using them to locally serve a Drupal website which is built via composer. Ideally I'd be using the same service to do the building as to do the serving (or at least an identically configured PHP). I've had no problem using docker-compose exec --user www-data php composer when the service is already running, but if I use docker-compose run --user www-data php composer I'm given the sudo prompt for www-data:

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

I can reproduce more simply with docker run -it --user www-data wodby/php:7.2 whoami. I'm assuming it's connected to the sudos in docker-entrypoint.sh.

It's low impact because there's a workaround, but at least for me it was quite confusing! (I'm not a Docker expert tho...) I was wondering if there was some way to make it work, or maybe if it was worth adding something to the readme?

Thanks again!

Cannot stop/start sshd container

Hello,

As the title suggests it is not possible to do stop/start with the sshd container. The container will not restart after a stop operation.

Run:

docker-compose stop
docker-compose start -d

Check containers using portainer or other tool. Notice the sshd container is stopped. Checking logs shows that the container attempted to regenerate the server ssh key file (/etc/ssh/ssh_host_rsa_key). Since the container was being restarted instead of recreated the server ssh key file already exists and causes a prompt for overwrite.

One way to fix would be to add a check for the existence of the key.

Cheers,

Michael

Unsatisfiable constraints

During a build with:

docker build -t wellnetimages/wodby-php:7.1-dev-1001-1001-4.7.3 --build-arg FROM_TAG=7.1.23 --build-arg PHP_DEV=1 --build-arg PHP_DEBUG= --build-arg WODBY_USER_ID=1001 --build-arg WODBY_GROUP_ID=1001 .

I get:

> Executing busybox-1.28.4-r1.trigger
> OK: 399 MiB in 149 packages
> + apk add -U --no-cache -t .php-edge-rundeps -X http://dl-cdn.alpinelinux.org/alpine/edge/testing/ -X http://dl-cdn.alpinelinux.org/alpine/edge/main/ -X http://dl-cdn.alpinelinux.org/alpine/edge/community/ 'freetype=2.9.1-r2' 'gnu-libiconv=1.15-r1' 'imagemagick=7.0.8.11-r0'
> fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
> fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
> fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
> fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
> fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
> ERROR: unsatisfiable constraints:
>   .php-edge-rundeps-0:
>     masked in: cache
>     satisfies: world[.php-edge-rundeps]

Environment Variables are ignored.

env variables set in .env are ignored.

PHP_TAG=7.2-dev-4.4.4

PHP_UPLOAD_MAX_FILESIZE=64M
PHP_POST_MAX_SIZE=64M
PHP_MAX_EXECUTION_TIME=300

This isn't being set properly.

Iconv implementation missing

The iconv extension is enabled, but there is no implementation available (like glibc). I tried with 7.2, 7.1 and 5.6 images.

The php.ini output:

iconv support => enabled
iconv implementation => unknown
iconv library version => unknown
iconv.input_encoding => no value => no value
iconv.internal_encoding => no value => no value
iconv.output_encoding => no value => no value

As a result the iconv() function fails with translit:
iconv('utf-8', 'ascii//TRANSLIT', 'test');

Notice: iconv(): Wrong charset, conversion from 'utf-8' to 'ascii//TRANSLIT' is not allowed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.