GithubHelp home page GithubHelp logo

Comments (12)

boedy avatar boedy commented on August 15, 2024 1

I think you should have used docker-php-ext-install for mcrypt

Something like this works for me (I probably also install some libraries which you don't need though. these you can leave out):

FROM php:5.6-cli

#update repo

RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng12-dev \
        libbz2-dev \
        php-pear \
        curl \
        git \
    && docker-php-ext-install iconv mcrypt \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd

#Download dependencies

# Set memory limit
RUN echo "memory_limit=1024M" > /usr/local/etc/php/conf.d/memory-limit.ini

# Set environmental variables
ENV COMPOSER_HOME /root/composer

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN docker-php-ext-install \
    zip \
    bz2 \
    iconv \
    mcrypt \
    mbstring

# Set up the application directory.
VOLUME ["/app"]
WORKDIR /app

# Set up the command arguments
CMD ["-"]
ENTRYPOINT ["composer", "--ansi"]

from docker-composer.

RobLoach avatar RobLoach commented on August 15, 2024

Interesting. Does a follow-up php5enmod mcrypt do anything?

from docker-composer.

cbeier avatar cbeier commented on August 15, 2024

No, that does nothing.

I think the problem comes from the base php:5.6-cli image. If I build a Dockerfile from scratch, then the mcrypt extension is loaded.

Dockerfile:

FROM debian:jessie

RUN apt-get update -y
RUN apt-get install -y php5-cli php5-dev php5-json curl git-core
RUN apt-get install -y zlib1g zlib1g-dev php5-common mcrypt
RUN apt-get install -y php5-curl php5-mcrypt php5-readline php-pear

RUN php5enmod curl json readline mcrypt pdo
RUN pecl install zip

# Set memory limit.
RUN echo "memory_limit=1024M" > /etc/php5/cli/conf.d/memory-limit.ini

RUN curl -sS https://getcomposer.org/installer | php

# Set up the command arguments
CMD ["-"]
ENTRYPOINT ["/composer.phar", "--ansi"]

Loaded modules:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

from docker-composer.

RobLoach avatar RobLoach commented on August 15, 2024

Think we should ditch php:5.6-cli?

from docker-composer.

cbeier avatar cbeier commented on August 15, 2024

Unfortunately, I do not know exactly what causing the problem inside the php image. But inside the php:5.6-cli image are some things adjusted (paths, compile options, ...) which deviate from the standard PHP installation on Debian.

from docker-composer.

RobLoach avatar RobLoach commented on August 15, 2024

@cbeier Is there another PHP-CLI Docker Container that you would recommend we use?

from docker-composer.

cbeier avatar cbeier commented on August 15, 2024

@RobLoach I have forked the container from ubermuda and customized (added necessary php extensions). My fork on github: https://github.com/cbeier/docker-composer and on docker: https://registry.hub.docker.com/u/cbeier/composer/

I currently know of no other php-cli container. Most container include php-cli with the used command line app.

from docker-composer.

boedy avatar boedy commented on August 15, 2024

I have the same problem with mcrypt. Now using your fork @cbeier .

from docker-composer.

RobLoach avatar RobLoach commented on August 15, 2024

Opened up a PR for this: #18

from docker-composer.

L0rD59 avatar L0rD59 commented on August 15, 2024

Hi,

I've similar issue with the mbstring extension see details here : https://bugs.php.net/bug.php?id=71181

from docker-composer.

sylus avatar sylus commented on August 15, 2024

I can't reproduce this anymore on a recent docker pull is this issue still present?

from docker-composer.

RobLoach avatar RobLoach commented on August 15, 2024

Going to close this for now. Feel free to open up a new issue if it persists.

from docker-composer.

Related Issues (20)

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.