Skip to main content

xdebug error

xdebug - failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 45: unknown instruction: ZEND_EXTENSION=XDEBUG.SO

 

How I got here

Running the following Docker command

docker-compose up

Generated this output:

Run Drupal 9 with Composer + Docker-compose + Nginx + MariaDB + PHP8.1

Running Docker

Dangerous word... I'm assuming that Docker is installed.  Don't know how to check?  Using Terminal (I prefer iTerm2), run the following command

docker -D info

 

The set-up

Go to your project directory, and create a docker folder and a “docker-compose.yml” file:

Docker - creating a container / image

Create and push to Docker Hub

Creating your own custom image... you need to have a Docker ID.  Not sure, well most likely you created it to download Docker Desktop.  If you don't have one, go to Docker and sign up.

In your  text editor create a file called Dockerfile in the same directory you want to have as your local site. No extension, just Dockerfile. Paste in this code and save the file:

Resetting Docker

Resetting Docker is basically following the start parameters.  All containers removed -

No containers running

Try running a container: Copy and paste this command into your terminal

docker run -d -p 80:80 docker/getting-started

Unable to find image 'docker/getting-started:latest' locally
latest: Pulling from docker/getting-started

 

Setting up a new local site environment

Setting up a new project in Docker and VS Code.

Using Terminal, go to your Sites directory and create a new directory using the mkdir command.  In this instance I'm going to create a new directory titled ADCE

shortcut command to access the Sites directory

cd ~/Sites

Create the new directory

mkdir ADCE

Go in to the new directory

cd ADCE

Run the devcontainer command

Applying a container using Docker

Running Docker in a new process and creating a container.

 

Go to the directory using the cd command.  In this instance in the sites directory:

cd ~/Sites

Create a new directory, which can be achieved using mkdir

mkdir mydir

If Docker has been installed then the next command will be all that is required

devcontainer

 

Subscribe to Docker