containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.01k stars 477 forks source link

Support for dockerfile_inline missing #864

Open wrobelda opened 7 months ago

wrobelda commented 7 months ago

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 .
kewiha commented 5 months ago

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

ja66 commented 2 months ago

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

BramvdnHeuvel commented 2 months ago

I'm having this issue as well! 🙋