Sign inSign up

magnobiet/php

By magnobiet

Updated over 6 years ago

PHP CLI Docker image with MySQL and Postgres client

Image
0

135

magnobiet/php repository overview

🐳 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

Tag summary

Content type

Image

Digest

Size

122.5 MB

Last updated

over 6 years ago

docker pull magnobiet/php:7.4-cli-alpine