phpearth / docker-php

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine
https://docs.php.earth/docker
MIT License
261 stars 80 forks source link

Add MQSeries php module #26

Closed adaliszk closed 5 years ago

adaliszk commented 5 years ago

This might be in a wrong place, this is more related to the alpine repository I think, but I'll open it here first so anybody who comes from the docker hub could see it directly.

It would be nice to have the IBMs WebSphere MQ series Queue managers module. It needs some work to build it and it would help a lot for enterprises who building on top of IBM systems: http://php.net/manual/en/book.mqseries.php

petk commented 5 years ago

Thanks for the suggestion. I'll check if it can be compiled. It looks like a bit outdated and unsynced PECL extension without a proper homepage or a source code repository... Last commit in the Git repository was 3 years ago, and last release on PECL was done last year: https://github.com/php/pecl-networking-mqseries/releases https://pecl.php.net/package/mqseries

Not something very promising yet... but I'll check.

adaliszk commented 5 years ago

Yeah in the mean time I have some progress on it, it's not nice :sweat_smile:

adaliszk commented 5 years ago

In order to build this you need to download the archive from the IBM site first and add it to the container yourself. I think this should be done by the image users so they can update the host package.

The archive can be found on: https://www-945.ibm.com/support/fixcentral/swg/selectFixes?product=ibm/WebSphere/WebSphere+MQ&release=7.5.0.9&platform=All&function=textSearch&text=client+install+&useReleaseAsTarget=true

I'm still working on the building process but here is the current state:

ENV PHP_VERSION="7.2" \
    PHPIZE_DEPS="git file re2c autoconf make zlib zlib-dev g++" \
    MQSERIES_DEPS="${PHPIZE_DEPS} php${PHP_VERSION}-dev rpm shadow" \
    MQSERIES_ARCHIVE="/tmp/mqseries.tar.gz" \
    MQSERIES_SRC="/tmp/mqseries" \
    RPM_INSTALL="rpm -ivh --nodeps --prefix /opt/mqm"

RUN apk add --no-cache ${MQSERIES_DEPS} "openjdk8-jre" \
 && mkdir -p "${MQSERIES_SRC}" && echo "Platform: $(uname)_$(uname -i)" \
 && tar -xzf "${MQSERIES_ARCHIVE}" -C "${MQSERIES_SRC}" \
 # The default mqlicense.sh sometimes fail, this is a fixed version (only needed if uname -i does not return your architecture)
 && cp "/tmp/mqlicense.sh" "${MQSERIES_SRC}/mqlicense.sh" \
 && bash -c "${MQSERIES_SRC}/mqlicense.sh -accept -jre /usr/bin/java" \
 && $RPM_INSTALL \
    "${MQSERIES_SRC}/MQSeriesRuntime-*.rpm" \
    "${MQSERIES_SRC}/MQSeriesSDK-*.rpm" \
    "${MQSERIES_SRC}/MQSeriesClient-*.rpm" \
 # Install mqseries module (a bit unstable!)
 && pecl bundle -f "mqseries" \
 && cd "$(pecl config-get temp_dir)/mqseries" \
 && phpize && ./configure --with-libdir=lib64 \
 && make && make install

I will get back to you with the working steps, I have some errors to resolve, but I wanted to share some state at least :man_technologist:

adaliszk commented 5 years ago

Maybe #27 would be a better solution to address this so at least you don't need to handle the pecl module installation and configuration

petk commented 5 years ago

Once the release will be published on the pecl site, I'll gladly go and add it here also. Until then this is way too hacky and looking like the extension should be replaced with something else for now... Thank you.