Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 1.03 KB

README.md

File metadata and controls

64 lines (47 loc) · 1.03 KB

🐳 PHP CLI

PHP CLI Docker image with MySQL and Postgres client

Build

docker build . -t magnobiet/php:7.4-cli-alpine

Publish

docker login
docker push magnobiet/php:7.4-cli-alpine

Setup

.bash_functions

function __php() {

  docker run \
    --rm \
    --interactive \
    --user $(id -u):$(id -g) \
    --volume /etc/passwd:/etc/passwd:ro \
    --volume /etc/group:/etc/group:ro \
    --volume $(pwd):/app \
    --workdir /app \
    --network host \
    magnobiet/php:7.4-cli-alpine \
    php "$@"

}

function __php_composer() {

  docker run \
    `tty -s && tty=--tty` \
    --interactive \
    --rm \
    --user $(id -u):$(id -g) \
    --network host \
    --volume /etc/passwd:/etc/passwd:ro \
    --volume /etc/group:/etc/group:ro \
    --volume $(pwd):/app \
    composer "$@"

}

.bash_aliases

alias php='__php'
alias composer='__php_composer'

License

This project is licensed under the MIT License. Copyright © Magno Biét