Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

magnobiet/docker-php-cli

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
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

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.