I’ve been following the Sitepoint tutorial/book PHP Novice to Ninja, and have used the info to build my own CMS. I followed the instruction contained with in the book for how to set up Docker, but don’t really understand how it works (or how to modify it)
I attempting to use a php function called imagecreatefromjpeg() which my installation of Docker doesn’t recognise [Fatal error: Uncaught Error: Call to undefined function imagecreatefromjpeg() ]
Apparently I need to install GD Library. I have found some forums that suggest i need to add
RUN docker-php-ext-install gd
to my Dockerfile, but I can’t figure out how to make Docker reconfigure with this command
Thanks for the the pointer. I tried that (with a few caveats listed below) and got the following error:
ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory
I think I’m running a very bespoke Docker set up as detailed here:
The folder containing all the Docker things doesn’t actually have a Dockerfile, it has a PHP.Dockerfile
Caveat: I don’t even know what a Docker image is and what i should type there (and I have tried to Google the matter and am no clearer). I’m assuming this will create a new Image so I can type a new name, but if it’s an existing name it could be related to the following:
My Docker folder contains a folder called ‘websites’ in which I can put further folders to develop sites and run them on the browser using ‘websitename.v.je’
So I’m presuming these might be the images. But I’ve tried it both ways (new image name & existing website folder) with no luck.
I tried copying the whole folder and running ‘docker compose up’ which did a lot of things in the terminal but eventually came to the error:
failed to solve: process “/bin/sh -c docker-php-ext-install gd” did not complete successfully: exit code: 1
I will add that tutorial to my list of things to learn but I’m not ready for a dive into learning to set up Docker at the moment, just hoping for a quick tweak to my existing environment