Skip to content

magnobiet/docker-php-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🐳 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

About

🐳 PHP CLI Docker image with MySQL and Postgres drives

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published