docker-library / httpd

Docker Official Image packaging for Apache HTTP Server
https://httpd.apache.org
Apache License 2.0
310 stars 345 forks source link

file not found in build context or excluded by .dockerignore: stat httpd-foreground: file does not exist #239

Closed glasswingprince closed 11 months ago

glasswingprince commented 1 year ago

in the DockerFile, line no 12, COPY httpd-foreground /usr/local/bin/

tianon commented 1 year ago

https://github.com/docker-library/httpd/blob/master/2.4/httpd-foreground ? :thinking: :confused:

(If you're building our Dockerfile from source for some reason, you probably want to use git clone instead of just downloading it.)

glasswingprince commented 1 year ago

Hello Team,

I have cloned.. but still getting the same error.

Regards Prince


From: Tianon Gravi @.> Sent: 28 June 2023 22:59 To: docker-library/httpd @.> Cc: Prince Kumar @.>; Author @.> Subject: Re: [docker-library/httpd] file not found in build context or excluded by .dockerignore: stat httpd-foreground: file does not exist (Issue #239)

https://github.com/docker-library/httpd/blob/master/2.4/httpd-foreground ? 🤔 😕

(If you're building our Dockerfile from source for some reason, you probably want to use git clone instead of just downloading it.)

— Reply to this email directly, view it on GitHubhttps://github.com/docker-library/httpd/issues/239#issuecomment-1611816205, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EY3F2VPNYCHICRFMHOTODXNRSWDANCNFSM6AAAAAAZXLDBII. You are receiving this because you authored the thread.Message ID: @.***>

tianon commented 1 year ago

I'm sorry, but without more information we won't be able to help. :sweat_smile:

I'm not able to reproduce with either of docker build 'https://github.com/docker-library/httpd.git#:2.4' or git clone https://github.com/docker-library/httpd.git && docker build httpd/2.4 :see_no_evil:

CapedBojji commented 1 year ago

This is still an issue, when doing FROM httpd:latest it produces that error

LaurentGoderre commented 1 year ago

Are you sure you are building in the right context (i.e. not building using the f flag and being in the wrong folder)?

CapedBojji commented 1 year ago

Are you sure you are building in the right context (i.e. not building using the f flag and being in the wrong folder)?

you are right. In my docker compose I had set the context to the directory where the docker file was located. but after removing that and just setting the dockerfile field to exactly where it is relative to the compose.yaml it worked. Btw what exactly is the context meant for?

LaurentGoderre commented 1 year ago

@CapedBojji the context is the directory that gets sent to the build. When building an image you can't include files that aren't in that context (like from your user's Download directory for example). The context is also used to determine what changed and if a cached layer can be used instead of rebuilding it