docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.79k stars 2k forks source link

Dockerfile [php:8.2.6-fpm-bullseye] not working #1408

Closed Mr-Lion closed 7 months ago

Mr-Lion commented 1 year ago

Hi,

I have a problem with my Dockerfile. I would like to start the image that is described in more detail in the title on my Windows 10 Enterprise system using Docker-Compose. But no matter what I've tried, it doesn't work. As soon as I use an older PHP version of Debian, it works. That means it must be due to the current faulty image.

My Dockerfile looks like this:

FROM php:8.2.6-fpm-bullseye

WORKDIR /var/www

RUN apt-get update && apt-get install -y \
    git \
    curl \
    zip \
    vim \
    unzip

And my docker-compose file like this:

version: '3.8'

services:
  app:
    build:
      context: ./
      dockerfile: Dockerfile
    container_name: my-app
    restart: always
    # working_dir: /var/www/
    # volumes:
    #   - ../app:/var/www

  nginx:
    image: nginx:latest
    container_name: nginx-srv
    restart: always
    ports:
      - "8080:80"
    # volumes:
    #   - ../app:/var/www
    #   - ./nginx:/etc/nginx/conf.d

Here is a screenshot of the whole process and the error message:

image

I list what I use here: Windows 10 Enterprise (all updates have been made) Docker Desktop (version 4.19.0) Hyper-V (also the latest version) VSCode Editor (version 1.78) I start the Docker-Compose file in the terminal of VSCode Editor.

I would be very grateful if someone could help me here and possibly fix these errors.

I thank you in advance.

Best regards

sbuerk commented 1 year ago

@Mr-Lion

I would guess that this is not a image/container issue itself. Sounds more like a generic windows docker issue recurring over time.

See for example: https://github.com/docker/for-win/issues/5763

Maybe something from there helps you ?

Mr-Lion commented 1 year ago

@sbuerk

Thanks for the answer.

What does that mean now? What's the solution now?

I couldn't understand anything in the example link and couldn't find any help.

My goal is to create an image of the latest PHP version on a Debian system where 2 web servers (Apache and Nginx) can work with it.

Do you have a solution for me how I could create the Dockerfile and the docker-compose-file?

I would be very happy if you could help me with this? I've been at it for a few days and haven't made any progress.

uvulpos commented 1 year ago

That's what I was trying to explain to you, this is a unknown issue of Docker and they don't know why that is exactly, the fix is just to pruge everything, reboot and start from scratch

https://github.com/docker/for-win/issues/5763#issuecomment-936254676

sbuerk commented 1 year ago

What does that mean now?

That means, that this is not an issue of a current image or your Dockerfile. It's an issue/bug in docker itself. Or to be more precise in "Docker Desktop for Windows".

What's the solution now?

I'm not into that topic (because of reasons ...). Just from scrolling through the linked issue, it seems that there is no real glue yet how and when it happens (for DDW) or how to (enforce) a reproduction of the issue.

Some people in the linked issue (note: it's a different repo and software), that throwing everything away helped them (cleanup) - starting new. So you could try that. Maybe getting help there instead.

Do you have a solution for me how I could create the Dockerfile and the docker-compose-file?

As I'm neither a docker-desktop user nor Windows at all I cannot really help you here, sorry for that. My Solutions would be unpopular anyway so I keep them "closed" ;) And as already mentioned, it's not about the Dockerfile or the docker-compose file. That means, this repository / issue tracker is the wrong place to get help for it.

My goal is to create an image of the latest PHP version on a Debian system where 2 web servers (Apache and Nginx) can work with it.

I got this. But you must understand, that the issue is something different. I mean, if you goot water in the living room from the top and trying to find the whole in the garagae - you would not find the issue or be able to fix it. Simply said: Searching on the wrong end.

Disclamer I'm not an official member / maintainer here - just jumped in as a normal consumer/user.

Mr-Lion commented 1 year ago

What does that mean now?

That means, that this is not an issue of a current image or your Dockerfile. It's an issue/bug in docker itself. Or to be more precise in "Docker Desktop for Windows".

yes thank you Found that out today too. The problem is with the Docker Desktop as you also say. Too bad this bug is not fixed.

What's the solution now?

I'm not into that topic (because of reasons ...). Just from scrolling through the linked issue, it seems that there is no real glue yet how and when it happens (for DDW) or how to (enforce) a reproduction of the issue.

Some people in the linked issue (note: it's a different repo and software), that throwing everything away helped them (cleanup) - starting new. So you could try that. Maybe getting help there instead.

Cleaning the Docker desktop didn't help and the function there is also completely faulty. However, I have had success with completely uninstalling the Docker desktop from my Windows and unfortunately I had to manually remove all remaining files and directories. After that, I restarted Windows and reinstalled the Docker desktop cleanly. I then tested my Dockerfile again and lo and behold, it worked and I no longer get an error.

Do you have a solution for me how I could create the Dockerfile and the docker-compose-file?

As I'm neither a docker-desktop user nor Windows at all I cannot really help you here, sorry for that. My Solutions would be unpopular anyway so I keep them "closed" ;) And as already mentioned, it's not about the Dockerfile or the docker-compose file. That means, this repository / issue tracker is the wrong place to get help for it.

Maybe your solution would be very interesting and helpful for me?!

My goal is to create an image of the latest PHP version on a Debian system where 2 web servers (Apache and Nginx) can work with it.

I got this. But you must understand, that the issue is something different. I mean, if you goot water in the living room from the top and trying to find the whole in the garagae - you would not find the issue or be able to fix it. Simply said: Searching on the wrong end.

Disclamer I'm not an official member / maintainer here - just jumped in as a normal consumer/user.

They say they will achieve my goal, then I would be really happy if they could help me and show me an example. Yes, meanwhile I understood that the above problem has nothing to do with Dockerfile and Docker-Compose. I was able to fix the problem by reinstalling Docker desktop.

So will you help me with my goal? Thank you in advance.

tianon commented 7 months ago

Sorry for the delay (we're not generally a "user support" forum here so we often miss things / prioritize bugs in the image).

From what I can tell, it looks like you probably had Docker Desktop set to use Windows containers instead of Linux containers (and this image does not support Windows containers).