podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

Support for dockerfile_inline missing

Open wrobelda opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Support for dockerfile_inline syntax was added to compose spec 2 years ago: (https://github.com/compose-spec/compose-spec/issues/298)

It seems, however, that podman is missing support for it. For example, the following example:

services:
  nfsvolumetest:
    build:
      context: .
      dockerfile_inline: |
        FROM docker.io/alpine:latest
        RUN apk update && apk add --update nfs-utils && rm -rf /var/cache/apk/*

results in:

podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.9.2
** excluding:  set()
['podman', 'inspect', '-t', 'image', '-f', '{{.Id}}', 'tmp_nfsvolumetest']
Error: unable to inspect "tmp_nfsvolumetest": failed to find image tmp_nfsvolumetest: tmp_nfsvolumetest: image not known
Traceback (most recent call last):
  File "/opt/homebrew/bin/podman-compose", line 33, in <module>
    sys.exit(load_entry_point('podman-compose==1.0.6', 'console_scripts', 'podman-compose')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 2941, in main
    podman_compose.run()
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 1423, in run
    cmd(self, args)
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 1754, in wrapped
    return func(*args, **kw)
           ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 2035, in compose_up
    compose.commands["build"](compose, build_args)
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 1754, in wrapped
    return func(*args, **kw)
           ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 1994, in compose_build
    build_one(compose, args, cnt)
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.11/site-packages/podman_compose.py", line 1957, in build_one
    raise OSError("Dockerfile not found in " + ctx)
OSError: Dockerfile not found in .

wrobelda avatar Mar 04 '24 21:03 wrobelda

I confirm dockerfile_inline doesn't seem to be parsed/implemented by podman-compose 1.0.6

kewiha avatar Apr 24 '24 22:04 kewiha

Any news here? This feature would allow me to switch from docker to podman.

ja66 avatar Jul 18 '24 14:07 ja66

I'm having this issue as well! 🙋

BramvdnHeuvel avatar Jul 25 '24 12:07 BramvdnHeuvel