Sign inSign up

gmitirol/alpine37-php71

By gmitirol

•Updated almost 6 years ago

Alpine 3.7 Docker image with PHP 7.1

Image
2

10K+

gmitirol/alpine37-php71 repository overview

⁠Docker image for PHP 7.1

Provides a PHP 7.1 docker image based on our Alpine Linux 3.7 base image⁠.

This image can be used as a base for the testing and deployment of PHP applications.

Included scripts:

ScriptPurpose
php-ext.shEnables, disables or shows PHP extensions
php-extensions.shProvides helper functions for getting available and default PHP extensions
setup-gitlab-token-auth.shConfigures git and composer authentication via GitLab CI token
setup-nginx.shConfigures the built-in nginx web server

Included tools:

ToolDescriptionWebsite
samiSami API documentation generatorhttps://github.com/FriendsOfPHP/Sami⁠
phpcsPHP CodeSnifferhttps://github.com/squizlabs/PHP_CodeSniffer/⁠

For running the PHP applications, a locked default user project with UID 1000 is created.

To build the docker image, do not forget to adapt the base image version in Dockerfile where necessary.

⁠Usage example (with custom GitLab server)

# .gitlab-ci.yml
stages:
  - test

test:
  stage: test
  image: gmitirol/alpine37-php71:v2
  artifacts:
    expire_in: 1 hour
    name: "$CI_PROJECT_PATH_SLUG-$CI_PIPELINE_ID"
    paths:
      - build/coverage
      - build/doc
  script:
    - php-ext.sh enable 'xdebug'
    - setup-gitlab-token-auth.sh "$CI_JOB_TOKEN" "gitlab.example.com"
    - composer install --no-progress
    - phpcs $CI_PROJECT_DIR/src $CI_PROJECT_DIR/tests --standard=PSR2
    - php vendor/bin/phpunit $CI_PROJECT_DIR/tests --coverage-text -vv --colors=never
    - sami update sami.php
  tags:
    - shared

Tag summary

Content type

Image

Digest

Size

76.6 MB

Last updated

almost 6 years ago

docker pull gmitirol/alpine37-php71