podman icon indicating copy to clipboard operation
podman copied to clipboard

podman docker build on compose

Open lorypelli opened this issue 3 months ago • 8 comments

Issue Description

build:
	context: .
	dockerfile: nginx/Dockerfile

fails, while

build:
	context: nginx/
	dockerfile: Dockerfile

doesn't (on docker compose this doesn't happen while on podman compose it does)

Steps to reproduce the issue

Steps to reproduce the issue

  1. install podman compose (pip3 install podman-compose)
  2. reproduce a compose.yaml file with that
  3. see that with docker compose nothing happens while with podman compose it does

Describe the results you received

it says that the Dockerfile isn't found

Describe the results you expected

Describe the results you expected

podman info output

If you are unable to run podman info for any reason, please provide the podman version, operating system and its version and the architecture you are running.

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

No

Additional environment details

Podman 6.0.2

Additional information

No response

lorypelli avatar Aug 06 '26 09:08 lorypelli

I'd like to investigate/work on this issue. Could it be assigned to me?

badal-coder avatar Aug 06 '26 10:08 badal-coder

I tried reproducing this with Podman 6.0.2 and podman-compose 1.6.0 using context: . and dockerfile: nginx/Dockerfile, but the build succeeds for me. Could you share your podman-compose --version output and the output of podman-compose --verbose build?

badal-coder avatar Aug 06 '26 10:08 badal-coder

I tried reproducing this with Podman 6.0.2 and podman-compose 1.6.0 using context: . and dockerfile: nginx/Dockerfile, but the build succeeds for me. Could you share your podman-compose --version output and the output of podman-compose --verbose build?

I fixed it by using context nginx/ and dockerfile Dockerfile, no problem, the only thing is that I wasn't able to do COPY../htpasswd/htpasswd.sh ./htpasswd.sh and i moved the file inside the nginx folder

lorypelli avatar Aug 06 '26 10:08 lorypelli

podman-compose version 1.6.0 podman version 6.0.2

lorypelli avatar Aug 06 '26 10:08 lorypelli

Could you also share the output of podman-compose --verbose build using the original failing configuration (context: . and dockerfile: nginx/Dockerfile)? Also, could you show the relevant project directory structure and the Dockerfile COPY lines? I tested the same Podman and podman-compose versions, but I haven't been able to reproduce the failure yet.

badal-coder avatar Aug 06 '26 10:08 badal-coder

Executing external compose provider "C:\Users\\AppData\Local\Python\pythoncore-3.14-64\Scripts\podman-compose.exe". Please see podman-compose(1) for how to disable this message. <<<<

INFO:podman_compose:['podman', '--version', ''] INFO:podman_compose:using podman version: 6.0.2 INFO:podman_compose:podman build -t testphp_php D:\Progetti\TestPHP\TestPHP INFO:podman_compose:podman build -t testphp_nginx D:\Progetti\TestPHP\TestPHP Error: no Containerfile or Dockerfile specified or found in context directory, D:\Progetti\TestPHP\TestPHP: The system cannot find the file specified. INFO:podman_compose:exit code: 125 Error: no Containerfile or Dockerfile specified or found in context directory, D:\Progetti\TestPHP\TestPHP: The system cannot find the file specified. INFO:podman_compose:exit code: 125 Error: executing C:\Users<username>\AppData\Local\Python\pythoncore-3.14-64\Scripts\podman-compose.exe --verbose build: exit status 125

Executing external compose provider "C:\Users\\AppData\Local\Python\pythoncore-3.14-64\Scripts\podman-compose.exe". Please see podman-compose(1) for how to disable this message. <<<<

INFO:podman_compose:['podman', '--version', ''] INFO:podman_compose:using podman version: 6.0.2 INFO:podman_compose:podman build -t testphp_php D:\Progetti\TestPHP\TestPHP\php INFO:podman_compose:podman build -t testphp_nginx D:\Progetti\TestPHP\TestPHP\nginx STEP 1/3: FROM dunglas/frankenphp:php8.4.5-alpine STEP 1/4: FROM nginx:1.27.5-alpine-slim STEP 2/4: RUN apk add --no-cache bash apache2-utils --> Using cache ea0b5d6efffb16e81392dfcf4ad61a394c5bfdb51633c2c2750098643fb8595e --> ea0b5d6efffb STEP 2/3: RUN apk add --no-cache postgresql-dev --> Using cache 43b27920978a7e25fde52eee3e83a791e556c590c7f991516978c384e46b6d6f --> 43b27920978a STEP 3/4: COPY htpasswd/htpasswd.sh ./htpasswd.sh STEP 3/3: RUN docker-php-ext-install pdo_pgsql --> Using cache 5ce4e60ec5c42552c0159e04783593d5a3bd4dcbab9440315d11bc3889f326cb COMMIT testphp_php --> 5ce4e60ec5c4 Successfully tagged localhost/testphp_php:latest 5ce4e60ec5c42552c0159e04783593d5a3bd4dcbab9440315d11bc3889f326cb Error: building at STEP "COPY htpasswd/htpasswd.sh ./htpasswd.sh": checking on sources under "/var/tmp/buildah-context-2115629044/overlay/77275143/merge": copier: stat:"/htpasswd/htpasswd.sh": no such file or directory

                                              INFO:podman_compose:exit code: 0

INFO:podman_compose:exit code: 125 Error: executing C:\Users<username>\AppData\Local\Python\pythoncore-3.14-64\Scripts\podman-compose.exe --verbose build: exit status 125

lorypelli avatar Aug 06 '26 10:08 lorypelli

I looked into this further and found that there was a fix in podman-compose merged after the v1.6.0 release.

The problem was that Windows paths like D:... could be interpreted as URLs and the custom dockerfile option was ignored. This seems consistent with your verbose output, as the generated podman build command does not contain the -f Dockerfile argument.

The fix is the a4c8067 commit.

Can you try the current main branch of podman-compose and see if the original context: . / dockerfile: nginx/Dockerfile configuration works ?

badal-coder avatar Aug 06 '26 11:08 badal-coder

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Sep 06 '26 01:09 github-actions[bot]