MilesChou / docker-phalcon

Dockerized Phalcon
https://hub.docker.com/repository/docker/mileschou/phalcon
MIT License
126 stars 41 forks source link

Add test command in build time #21

Closed MilesChou closed 6 years ago

MilesChou commented 6 years ago

Run dev tools cil for test in build time.

See https://github.com/phalcon/phalcon-devtools/blob/master/phalcon.php

Also, I add a new maintainer. Thanks fizzka.

MilesChou commented 6 years ago

I adjust 7.x-alpine image, but 5.x-alpine is not work using docker-php-ext-install.

fizzka commented 6 years ago

could you show not working php5 dockerfile? i'll try to find solution

2018-01-23 9:03 GMT+03:00 MilesChou notifications@github.com:

I adjust 7.x-alpine image, but 5.x-alpine is not work using docker-php-ext-install.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/MilesChou/docker-phalcon/pull/21#issuecomment-359685633, or mute the thread https://github.com/notifications/unsubscribe-auth/ACRjYK6TinmlDE4ZQWh6nVtHZWttFrs_ks5tNXY6gaJpZM4Rmlwr .

MilesChou commented 6 years ago

FYI:

FROM php:5.5-alpine

LABEL maintainer="MilesChou <github.com/MilesChou>"
LABEL maintainer="fizzka <github.com/fizzka>"

ARG PHALCON_VERSION=3.3.1
ARG PHALCON_DEV_TOOLS_VERSION=3.2.12
ARG PHALCON_EXT_PATH=php5/64bits

RUN set -xe && \
        # Compile Phalcon
        curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \
        tar xzf v${PHALCON_VERSION}.tar.gz && \
        docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) /cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH} && \

        # Insall Phalcon Devtools for testing, see https://github.com/phalcon/phalcon-devtools/
        curl -LO https://github.com/phalcon/phalcon-devtools/archive/v${PHALCON_DEV_TOOLS_VERSION}.tar.gz && \
        tar xzf v${PHALCON_DEV_TOOLS_VERSION}.tar.gz && \

        # Test Phalcon using Phalcon Devtools
        php /phalcon-devtools-3.2.12/phalcon.php && \

        # Remove all temp files
        rm -rf \
            v${PHALCON_VERSION}.tar.gz \
            /cphalcon-${PHALCON_VERSION} \
            v${PHALCON_DEV_TOOLS_VERSION}.tar.gz \
            phalcon-devtools-${PHALCON_DEV_TOOLS_VERSION}

It will be failure at docker-php-ext-install command.

BTW, 5.6-alpine is okay.

fizzka commented 6 years ago

Insall Phalcon Devtools -> # Install Phalcon Devtools

typo everywhere (copypaste)

i'll check docker-php-ext-install

2018-01-23 9:48 GMT+03:00 MilesChou notifications@github.com:

FROM php:5.5-alpine LABEL maintainer="MilesChou <github.com/MilesChou>"LABEL maintainer="fizzka <github.com/fizzka>" ARG PHALCON_VERSION=3.3.1ARG PHALCON_DEV_TOOLS_VERSION=3.2.12ARG PHALCON_EXT_PATH=php5/64bits RUN set -xe && \

Compile Phalcon

    curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \
    tar xzf v${PHALCON_VERSION}.tar.gz && \
    docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) /cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH} && \

    # Insall Phalcon Devtools for testing, see https://github.com/phalcon/phalcon-devtools/
    curl -LO https://github.com/phalcon/phalcon-devtools/archive/v${PHALCON_DEV_TOOLS_VERSION}.tar.gz && \
    tar xzf v${PHALCON_DEV_TOOLS_VERSION}.tar.gz && \

    # Test Phalcon using Phalcon Devtools
    php /phalcon-devtools-3.2.12/phalcon.php && \

    # Remove all temp files
    rm -rf \
        v${PHALCON_VERSION}.tar.gz \
        /cphalcon-${PHALCON_VERSION} \
        v${PHALCON_DEV_TOOLS_VERSION}.tar.gz \
        phalcon-devtools-${PHALCON_DEV_TOOLS_VERSION}

It will be failure at docker-php-ext-install command.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/MilesChou/docker-phalcon/pull/21#issuecomment-359692329, or mute the thread https://github.com/notifications/unsubscribe-auth/ACRjYDkDJT-6lgiRMzKOp_zmoJU_Qjytks5tNYCggaJpZM4Rmlwr .

fizzka commented 6 years ago

reason why php5.5 fails build is docker-php-ext-install prior 5.6 cant use external path as extension. my workaround here (docker-php-source extract & symlink):

FROM php:5.5-alpine

LABEL maintainer="MilesChou <github.com/MilesChou>"
LABEL maintainer="fizzka <github.com/fizzka>"

ARG PHALCON_VERSION=3.3.1
ARG PHALCON_DEV_TOOLS_VERSION=3.2.12
ARG PHALCON_EXT_PATH=php5/64bits

RUN set -xe && \
        # Compile Phalcon
        curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \
        tar xzf v${PHALCON_VERSION}.tar.gz && \
        docker-php-source extract && \
        ln -s /cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH} /usr/src/php/ext/phalcon && \
        docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) phalcon && \
        docker-php-source delete &&\

        # Insall Phalcon Devtools for testing, see https://github.com/phalcon/phalcon-devtools/
        curl -LO https://github.com/phalcon/phalcon-devtools/archive/v${PHALCON_DEV_TOOLS_VERSION}.tar.gz && \
        tar xzf v${PHALCON_DEV_TOOLS_VERSION}.tar.gz && \

        # Test Phalcon using Phalcon Devtools
        php /phalcon-devtools-3.2.12/phalcon.php && \

        # Remove all temp files
        rm -rf \
            v${PHALCON_VERSION}.tar.gz \
            /cphalcon-${PHALCON_VERSION} \
            v${PHALCON_DEV_TOOLS_VERSION}.tar.gz \
            phalcon-devtools-${PHALCON_DEV_TOOLS_VERSION}
MilesChou commented 6 years ago

Great!! I use your revision to commit.

I will merge Alpine image first if CI server has no problems.

fizzka commented 6 years ago

need to same workarounds for debian-based images?