Skip to content

Instantly share code, notes, and snippets.

@lotharthesavior
Last active March 5, 2022 18:49
Show Gist options
  • Save lotharthesavior/d07bcdfd7dda73bf5202a86bd4437c38 to your computer and use it in GitHub Desktop.
Save lotharthesavior/d07bcdfd7dda73bf5202a86bd4437c38 to your computer and use it in GitHub Desktop.
Run php where you have only docker
FROM php:7.4
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
RUN apt-get install -y libzip-dev \
&& docker-php-ext-install zip
#!/bin/bash
function php7 {
docker run --rm -v $(pwd):/app -w /app $(docker build -q -f $HOME/DockerImages/Dockerfile-php7 $HOME/DockerImages) php $1 $2 $3
}
@lotharthesavior
Copy link
Author

lotharthesavior commented Jul 27, 2021

The intention is to add the function at php7.sh in your bash profile.

Usage:

php7 index.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment