Giter Site home page Giter Site logo

support for volumes about podman-compose HOT 71 CLOSED

containers avatar containers commented on August 16, 2024 16
support for volumes

from podman-compose.

Comments (71)

x80486 avatar x80486 commented on August 16, 2024 27

Not trying to be pushy or anything like that, but wouldn't be better to make a release with all the changes you folks have made since 0.1.5? I think there is a lot of work already and releasing more frequently will give you more chances to make podman-compose better because more users are going to use/test it 🥳

from podman-compose.

mpnordland avatar mpnordland commented on August 16, 2024 19

Since this issue seems to be tracking volumes support, I'll add this here.
At this line:

src = json.loads(out)[0]["mountPoint"]

In podman v1.6.0 the key is spelled "Mountpoint". This causes the following stacktrace:

Traceback (most recent call last):
  File "/home/micah/dev/boilerplate/venv/bin/podman-compose", line 10, in <module>
    sys.exit(main())
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 1093, in main
    podman_compose.run()
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 625, in run
    cmd(self, args)
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 782, in wrapped
    return func(*args, **kw)
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 898, in compose_up
    detached=args.detach, podman_command=podman_command)
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 457, in container_to_args
    mount_args = mount_desc_to_args(compose, volume, cnt['_service'], cnt['name'])
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 386, in mount_desc_to_args
    mount_desc = mount_dict_vol_to_bind(compose, fix_mount_dict(mount_desc, proj_name, srv_name))
  File "/home/micah/dev/boilerplate/venv/lib/python3.7/site-packages/podman_compose.py", line 366, in mount_dict_vol_to_bind
    src = json.loads(out)[0]["mountPoint"]
KeyError: 'mountPoint'

from podman-compose.

allquixotic avatar allquixotic commented on August 16, 2024 19

Hello! It has been quite some months and the KeyError: 'mountPoint' issue still persists with the package in PyPi. Is a release forthcoming? Thanks!

from podman-compose.

thegarlynch avatar thegarlynch commented on August 16, 2024 17

Still no release ? if you don't want it, atleast just made tagged release for devel branch so some linux distro can pinpoint to it

from podman-compose.

tinywrkb avatar tinywrkb commented on August 16, 2024 10

For my needs, the new volumes support working great. I tested named volumes, bind mounts (short syntax) with relative and absolute paths.
I suspect like myself, other users might find podman-compose barely usable without volumes support, so it would be nice to see a new release being tagged off master.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024 8

but this is already handled here

https://github.com/containers/podman-compose/blob/devel/podman_compose.py#L384

    try:
        src = json.loads(out)[0]["mountPoint"]
    except KeyError:
        src = json.loads(out)[0]["Mountpoint"]

please use devel branch as in README.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024 6

Fixing Mounts and up then release

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024 5

the long syntax has 3 types: volume, bind or tmpfs

- type: volume
  source: mydata # this is a name
  target: /data
  read_only: false
  # type-specific options
  tmpfs: {size: 123, mode: 1777}
  volume: {nocopy: true} 
  bind: {propagation: Z, z, shared, slave, private, rshared, rslave, or rprivate(default)}

there are more than one shorthand syntax for compose

  # Just specify a path and let the Engine create a volume
  - /var/lib/mysql

  # Specify an absolute path mapping
  - /opt/data:/var/lib/mysql

  # Path on the host, relative to the Compose file
  - ./cache:/tmp/cache

  # User-relative path
  - ~/configs:/etc/configs/:ro

  # Named volume
  - datavolume:/var/lib/mysql

those can be passed to podman using: (which is what currently used)

  • --tmpfs /tmp:rw,size=787448k,mode=1777
  • -v HOST-DIR:CONTAINER-DIR:OPTIONS

where options can be

  • [rw|ro]
  • [z|Z]
  • [[r]shared|[r]slave|[r]private]

or unified --mount like this

  • --mount type=tmpfs,tmpfs-size=512M,destination=/path/in/container
  • --mount type=bind,source=/path/on/host,destination=/path/in/container

from podman-compose.

xtrasimplicity avatar xtrasimplicity commented on August 16, 2024 5

but this is already handled here

https://github.com/containers/podman-compose/blob/devel/podman_compose.py#L384

    try:
        src = json.loads(out)[0]["mountPoint"]
    except KeyError:
        src = json.loads(out)[0]["Mountpoint"]

please use devel branch as in README.

Is there a new pip-release scheduled? It was quite surprising to install the latest version via pip expecting a functional, drop-in docker-compose replacement, but to then immediately run into this issue when running podman-compose up.

from podman-compose.

salotz avatar salotz commented on August 16, 2024 5

Using 0.1.5 I had to change the 'mountPoint' to 'Mountpoint' when using a config like this:

volumes:
    grafana_data: {}
services:
  grafana:

    volumes:
      - ./volumes/grafana/provisioning:/etc/grafana/provisioning
      - grafana_data:/var/lib/grafana

Error:

podman volume inspect compose_grafana_data || podman volume create compose_grafana_data
Traceback (most recent call last):
  File "/home/salotz/.local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 1093, in main
    podman_compose.run()
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 625, in run
    cmd(self, args)
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 782, in wrapped
    return func(*args, **kw)
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 897, in compose_up
    podman_args = container_to_args(compose, cnt,
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 457, in container_to_args
    mount_args = mount_desc_to_args(compose, volume, cnt['_service'], cnt['name'])
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 386, in mount_desc_to_args
    mount_desc = mount_dict_vol_to_bind(compose, fix_mount_dict(mount_desc, proj_name, srv_name))
  File "/home/salotz/.local/pipx/venvs/podman-compose/lib/python3.8/site-packages/podman_compose.py", line 366, in mount_dict_vol_to_bind
    src = json.loads(out)[0]["mountPoint"]
KeyError: 'mountPoint'

JSON response:

--> podman volume inspect compose_grafana_data
[
     {
          "Name": "compose_grafana_data",
          "Driver": "local",
          "Mountpoint": "/home/salotz/.local/share/containers/storage/volumes/compose_grafana_data/_data",
          "CreatedAt": "2020-05-27T12:18:58.217834764-04:00",
          "Labels": {
               "io.podman.compose.project": "compose"
          },
          "Scope": "local",
          "Options": {
               
          }
     }
]

from podman-compose.

ChristophP avatar ChristophP commented on August 16, 2024 5

I've tried to make it work on Mac but with no lack. :(

Same here. Does anyone know if there is a way to expose the podman backend from inside the VM to the host MacOS system?

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024 4

thank you.

I'll keep this ticket open until I test all cases.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024 2

yes, please don't use 0.1.5, use the latest devel branch instead

pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz

from podman-compose.

djnotes avatar djnotes commented on August 16, 2024 2

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024 2

I'll close this, because latest version of podman-compose solved it.
please if you have an issue reported separately with full details.

we have an issue reported for macos, I don't have a mac, I'm using fedora. so I can't help with that.

from podman-compose.

alex198710 avatar alex198710 commented on August 16, 2024 2

Thanks @burredis,
I also found https://rancherdesktop.io/
I will check both.
Regards

from podman-compose.

djnotes avatar djnotes commented on August 16, 2024 1

There is not much point in using podman-compose anymore, while Podman supports Docker-Compose. You can use Docker Compose with Podman backend now.

from podman-compose.

burredis avatar burredis commented on August 16, 2024 1

Hey alex198710,
The solution that I found is to use colima. It works all that I need.
Can I start docker and all commands and features.

Regards

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

"just" volumes is already supported, but shared volumes needs some work. I'll see what I can do.

from podman-compose.

chpio avatar chpio commented on August 16, 2024

"just" volumes is already supported

im getting an error for

services:
  web:
    # ...
    volumes:
      - "/var/www/storage"

Error: incorrect volume format "/var/www/storage", should be host-dir:ctr-dir[:option]

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

understood, so the podman commands would be

$ podman volume create myvol
$ v=`podman volume inspect myvol | jq -r '.[0].mountPoint'`
$ podman run -v $v:/var/www/storage  ...

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

@chpio please test, this is now fully implemented

5606c69

and

fc61e01

from podman-compose.

chpio avatar chpio commented on August 16, 2024

thank you!

those commits seem to have broken something:

on commit fc61e01 (882cef7 seem to work fine)

$ podman-compose up
podman stop -t=1 foo_web_1
Error: no container with name or ID foo_web_1 found: no such container
125
podman rm foo_web_1
Error: no container with name or ID foo_web_1 found: no such container
1
podman pod rm foo
Error: no pod with name or ID foo found: no such pod
125
podman pod create --name=foo --share net -p 8080:80
c5c2a81eac58619f51540ea97394cee227d648c94664c1c3b87809a82e5ce5cf
0
Traceback (most recent call last):
  File "/home/thomas/bin/podman-compose", line 710, in <module>
    main()
  File "/home/thomas/bin/podman-compose", line 705, in main
    podman_path=args.podman_path
  File "/home/thomas/bin/podman-compose", line 665, in run_compose
    no_cleanup, dry_run, podman_path, shared_vols)
  File "/home/thomas/bin/podman-compose", line 555, in up
    args = container_to_args(cnt, dirname, podman_path, shared_vols)
  File "/home/thomas/bin/podman-compose", line 434, in container_to_args
    i, podman_path, cnt['_dirname'],
KeyError: '_dirname'

My dockerfile:

version: '3'
services:
  web:
    build: containers/web
    ports:
      - "8080:80"
    volumes:
      - ./dist:/var/www/html

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I've just pushed a29cf06

please test

from podman-compose.

chpio avatar chpio commented on August 16, 2024

im getting this now

Traceback (most recent call last):
  File "/home/thomas/bin/podman-compose", line 740, in <module>
    main()
  File "/home/thomas/bin/podman-compose", line 735, in main
    podman_path=args.podman_path
  File "/home/thomas/bin/podman-compose", line 693, in run_compose
    no_cleanup, dry_run, podman_path, shared_vols)
  File "/home/thomas/bin/podman-compose", line 570, in up
    args = container_to_args(cnt, dirname, podman_path, shared_vols)
  File "/home/thomas/bin/podman-compose", line 436, in container_to_args
    shared_vols
  File "/home/thomas/bin/podman-compose", line 362, in mount_desc_to_args
    if is_str(mount_desc): mount_desc=parse_short_mount(mount_desc, basedir)
  File "/home/thomas/bin/podman-compose", line 78, in parse_short_mount
    for opt in mount_opt.split(','):
AttributeError: 'NoneType' object has no attribute 'split'

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I've handled the case, please try now

from podman-compose.

chpio avatar chpio commented on August 16, 2024
Traceback (most recent call last):
  File "/home/thomas/bin/podman-compose", line 741, in <module>
    main()
  File "/home/thomas/bin/podman-compose", line 736, in main
    podman_path=args.podman_path
  File "/home/thomas/bin/podman-compose", line 694, in run_compose
    no_cleanup, dry_run, podman_path, shared_vols)
  File "/home/thomas/bin/podman-compose", line 571, in up
    args = container_to_args(cnt, dirname, podman_path, shared_vols)
  File "/home/thomas/bin/podman-compose", line 437, in container_to_args
    shared_vols
  File "/home/thomas/bin/podman-compose", line 365, in mount_desc_to_args
    mount_type = mount_desc.get("type")
AttributeError: 'NoneType' object has no attribute 'get'

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I've sorry for bothering you with me. I've pushed a fix. I'll create a compose file and test all the cases ASAP

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I've fixed all of issues and added tests

as you can see here and here

from podman-compose.

chpio avatar chpio commented on August 16, 2024

thx, that dockerfile from above is working now, but i haven't tested volumes as a whole ("external" volumes syntax).

from podman-compose.

cognition9144 avatar cognition9144 commented on August 16, 2024

Volumes currently works well. But the way podman-compose claims volumes might require some polish.

It allocates the volume and uses --mount <type, source, dest> to mount that path, instead of -v <volume_name>. But if we then execute podman prune, those volumes are considered as orphans and will be removed.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

how do you suggesting passing them to podman run?

from podman-compose.

cognition9144 avatar cognition9144 commented on August 16, 2024

how do you suggesting passing them to podman run?

podman run -m data:/app/data

Although it's undocumented, it works the same way as Docker's named volumes.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

starting from which podman version they have this option?

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I've podman 1.2.0 and it shows

$ podman run --help
...
  -m, --memory string                            Memory limit (format: <number>[<unit>], where unit = b, k, m or g)
...

from podman-compose.

cognition9144 avatar cognition9144 commented on August 16, 2024

I've podman 1.2.0 and it shows

$ podman run --help
...
  -m, --memory string                            Memory limit (format: <number>[<unit>], where unit = b, k, m or g)
...

Sorry, my mistake. They don't have -m, but they have -v, --mount, and --volume.
sudo podman run --rm -v test-data:/data ubuntu is definitely valid.

➜  ~ sudo podman run --rm -v test-data:/data ubuntu   
➜  ~ sudo podman volume ls
DRIVER   VOLUME NAME
local    test-data

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I've reviewed the code and found that I'm already using --mount and we can easily pass it as-is if supported by podman. we just need to know when podman run --mount type=volume:source=vol-name:destination=/path/to/target is supported

       type=volume,source=my-volume,destination=/path/in/container,volume-label="color=red",volume-label="shape=round"

from podman-compose.

cognition9144 avatar cognition9144 commented on August 16, 2024

I've reviewed the code and found that I'm already using --mount and we can easily pass it as-is if supported by podman. we just need to know when podman run --mount type=volume:source=vol-name:destination=/path/to/target is supported

       type=volume,source=my-volume,destination=/path/in/container,volume-label="color=red",volume-label="shape=round"

I don't know when exactly it is supported. And according to the discussion in containers/podman#3811 they fogot to add documentation when they add that functionality.

I just know that podman 1.4.4 supports it.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

we need to know how to pass :z for volume types.

#41 (comment)

from podman-compose.

dinokov avatar dinokov commented on August 16, 2024

I have the same problem.
Every time I put top-level volumes key in docker-compose.yml file I get the same error after running :

podman-compose up

...
podman volume inspect webdevops-1604_mysql || podman volume create webdevops-1604_mysql
Traceback (most recent call last):
  File "/home/damir/.local/bin/podman-compose", line 10, in <module>
    sys.exit(main())
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 1093, in main
    podman_compose.run()
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 625, in run
    cmd(self, args)
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 782, in wrapped
    return func(*args, **kw)
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 898, in compose_up
    detached=args.detach, podman_command=podman_command)
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 457, in container_to_args
    mount_args = mount_desc_to_args(compose, volume, cnt['_service'], cnt['name'])
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 386, in mount_desc_to_args
    mount_desc = mount_dict_vol_to_bind(compose, fix_mount_dict(mount_desc, proj_name, srv_name))
  File "/home/damir/.local/lib/python3.7/site-packages/podman_compose.py", line 366, in mount_dict_vol_to_bind
    src = json.loads(out)[0]["mountPoint"]
KeyError: 'mountPoint'

If I comment out last lines like this:

     #volumes:
       #phpmyadmin:
       #db_data: 

then the error is no more !
I am using podman version 1.6.1

from podman-compose.

dinokov avatar dinokov commented on August 16, 2024

I installed devel branch and can use volumes now .

Thank you very much !

from podman-compose.

Herokal avatar Herokal commented on August 16, 2024

Hey, not sure if this is still current, but it seems fitting for my issue:
System: CentOS8 using python 3.6 with podman 1.0.5

On inspection of volumes, the command podman volume inspect {volname} seems to return

"null\n"

along with the returncode 0.

As a result, in line 381, no subprocess.CalledProcessError is raised and podman-compose doesn't try to create it.
It works as intended using the following modification:

    try:
        out = compose.podman.output(["volume", "inspect", vol_name]).decode('utf-8')
        if out == "null\n":
            raise subprocess.CalledProcessError(0, "podman volume inspect "+vol_name)
    except subprocess.CalledProcessError:

I did not create a pull-request since it is a small change and kind of a hacky solution :/

from podman-compose.

mheon avatar mheon commented on August 16, 2024

from podman-compose.

leonardehrenfried avatar leonardehrenfried commented on August 16, 2024

from podman-compose.

Herokal avatar Herokal commented on August 16, 2024

The problem is that out = "null\n" in my situation (since podman doesn't error but doesn't return anything either), and so the json parsing always fails :/
I was using the devel branch for that.

from podman-compose.

jaorueta avatar jaorueta commented on August 16, 2024

In the function mount_desc_to_args:

if mount_type=='bind':
elif mount_type=='tmpfs':
else:
raise ValueError("unknown mount type:"+mount_type)

If I understand ok, it not possible to declare type:volume in the composer file. I say this because only volume pre-populate the volume.

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

We support volume,
We inspect volume get its dir and convert it to bind.

I'm going to change this

from podman-compose.

jaorueta avatar jaorueta commented on August 16, 2024

Maybe add some like:

    elif mount_type=='volume':
        return "type=volume,source={source},destination={target},{opts}".format(
            source=source,
            target=target,
            opts=opts
).rstrip(",")

from podman-compose.

wheresalice avatar wheresalice commented on August 16, 2024

I have been struggling to get this working today. The following simply didn't work at all, with no errors:

volumes:
    - ./data:/data/

After much trial and error, I finally discovered that I need to set the full path, and use the long-form method for defining volumes:

    volumes:
     - type: bind
       source: /home/alice/ct/data
       target: /data

from podman-compose.

kiview avatar kiview commented on August 16, 2024

@wheresalice
But this kind of breaks the purpose of having a relative path in the local directory in the first place.

@muayyad-alsadi
Does this mean relative paths in short are not supported atm? Should I raise a seperate issue for this?

from podman-compose.

jerdna-regeiz avatar jerdna-regeiz commented on August 16, 2024

@wheresalice
But this kind of breaks the purpose of having a relative path in the local directory in the first place.

If it helps, it helps ;)
But it does not solve further problems (like pre-population).

@muayyad-alsadi
Does this mean relative paths in short are not supported atm? Should I raise a seperate issue for this?

Relative paths are supported, but are converted into absolute paths. The issue is more to Use the real volume mechanism instead of bind.

I'll share a pull request lauter today, which fixes the issues at least for me.

from podman-compose.

n1trux avatar n1trux commented on August 16, 2024

For some reason:

services:
  php:
    image: sqstorage:master
    build: .
    volumes:
      - "app:/app"
      - "./dba.php:/app/support/dba.php:ro"

maps to

[…] --mount type=bind,source=/sqstorage/./dba.php,destination=/app/support/dba.php,ro sqstorage:master […]

which leads to:

Error: error checking path "/srv/pod/sqstorage/./dba.php": stat /srv/pod/sqstorage/./dba.php: no such file or directory

Will that be fixed by #117?

from podman-compose.

djnotes avatar djnotes commented on August 16, 2024

I am bind mounting. It seems the bind is successful, but new changes I apply to code do not get reflected in the running app. Here's my docker-compose.yml:

version: '3.0'


services:
    web:
        build: .
        ports:
            - 8000:80
        volumes:
            - .:/var/www/html,Z

Dockerfile:

FROM php:7.4-apache

RUN apt-get update \
    &&  apt-get install -y nano \
    && docker-php-ext-install pdo \
    && pecl install xdebug \
    && docker-php-ext-enable xdebug

COPY . /var/www/html

WORKDIR /var/www/html

CMD ["apachectl","-DFOREGROUND"]

from podman-compose.

x80486 avatar x80486 commented on August 16, 2024

I'm using podman-compose-0.1.5, podman-2.0.6, and buildah-1.16.0. I have this simple docker-compose.yml file:

version: "3.8"

services:
  database:
    container_name: postgres-database
    environment:
      - POSTGRES_DB=${DB_NAME:-postgres}
      - POSTGRES_PASSWORD=${DB_PASSWORD:-NgdnckG0z9Er7ASg}
      - POSTGRES_USER=${DB_USER:-postgres}
    healthcheck:
      interval: 10s
      retries: 3
      test: ["CMD", "pg_isready", "--username", "postgres"]
      timeout: 30s
    image: docker.io/library/postgres:12.4-alpine     # https://hub.docker.com/_/postgres/
    networks:
      - global-network
    ports:
      - "5432:5432"
    restart: on-failure
    volumes:
      - "postgres-data:/var/lib/postgresql/data/"

networks:
  global-network:
    driver: bridge
    name: kong-network

...and I'm always getting some similar error message(s):

[x80486@uplink:~/Workshop/Development/kong-api-gateway]$ podman-compose up --build --detach 
podman pod create --name=kong-api-gateway --share net -p 5432:5432
a379479ebd8f6f596a0e62248c4480a7481c6295600f1a03d9909f92a034d285
0
podman volume inspect kong-api-gateway_postgres-data || podman volume create kong-api-gateway_postgres-data
Error: error inspecting volume kong-api-gateway_postgres-data: no volume with name "kong-api-gateway_postgres-data" found: no such volume
Traceback (most recent call last):
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/bin/.podman-compose-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 1093, in main
    podman_compose.run()
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 625, in run
    cmd(self, args)
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 782, in wrapped
    return func(*args, **kw)
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 897, in compose_up
    podman_args = container_to_args(compose, cnt,
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 457, in container_to_args
    mount_args = mount_desc_to_args(compose, volume, cnt['_service'], cnt['name'])
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 386, in mount_desc_to_args
    mount_desc = mount_dict_vol_to_bind(compose, fix_mount_dict(mount_desc, proj_name, srv_name))
  File "/nix/store/591n4x5vk8j55gzi8lrx5gjx7x3lh9n9-podman-compose-0.1.5/lib/python3.8/site-packages/podman_compose.py", line 366, in mount_dict_vol_to_bind
    src = json.loads(out)[0]["mountPoint"]
KeyError: 'mountPoint'

Is there a workaround for this?

from podman-compose.

Marek77 avatar Marek77 commented on August 16, 2024

Hello, we have the same issue ("mountPoint" vs "Mountpoint") with pip3-installed podman-compose (not devel). Can we please get this fix merged and released ?

from podman-compose.

Jasstkn avatar Jasstkn commented on August 16, 2024

Hi. Same issue here :(

KeyError: 'mountPoint'

from podman-compose.

unixfox avatar unixfox commented on August 16, 2024

There is not much point in using podman-compose anymore, while Podman supports Docker-Compose. You can use Docker Compose with Podman backend now.

How so? Could you link to us to an article about that?

from podman-compose.

Jasstkn avatar Jasstkn commented on August 16, 2024

There is not much point in using podman-compose anymore, while Podman supports Docker-Compose. You can use Docker Compose with Podman backend now.

I've tried to make it work on Mac but with no lack. :(

from podman-compose.

stellarpower avatar stellarpower commented on August 16, 2024

There is not much point in using podman-compose anymore, while Podman supports Docker-Compose. You can use Docker Compose with Podman backend now.

I didn't know we had full support. Ideally I should just move to K8s yaml as my last foray into Ansible wasn't a lot neater.

I am experienceing a bit of trouble with a sort-of hack I used in docker to get bind-mounted named volumes:

version: 3.3
services:
  foo:
    image: ..
    volumes: foo_Config:/config
volumes:
    foo_Config:
      driver: local
      driver_opts:
        device:    $VolumeRoot/foo/Config
        o:         bind
        type:      none

Not sure if it belongs here, or a separate issue (or if it could be in Podman itself - would need to work out the correct equivalent chain of CLI commands first). It took quite some time to find out how to do this in Docker, as everything was either named volume or bind-mount, not both as I wanted, to share between containers but back with ZFS.

Is this still worth following up on reporting this, or is development on podman-compose likely to draw to a close if docker-compose can be used instead? Struggling to find much time for GH outside of work these days, but I have a couple more things I've found in podman-compose, and I try to report a least, otherwise nothing can ever be fixed.

from podman-compose.

burredis avatar burredis commented on August 16, 2024

Hello everybody

I'm using macOS and this issue happened to me.

Return:

Error: statfs /foo/bar: no such file or directory
exit code: 125

Versions:

using podman version: 3.4.4
podman-composer version  1.0.3
podman --version 
podman version 3.4.4

Does someone have the solution?

Regards,

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

I was told that there is a bug in on MacOS when passing ./somthing/otherthing that does not happen when using somthing/otherthing

I don't have mac.

from podman-compose.

alex198710 avatar alex198710 commented on August 16, 2024

Hello @burredis,
I have the exact same problem and the same podman versions.
Did you find any solution?
Thanks in advance,
Regards,

from podman-compose.

toanvo288 avatar toanvo288 commented on August 16, 2024

Hi there, I using MacOS version Monterey. The volumes tag in compose file does not work at all.
Noted: I have used PostgreSQL image from docker.io
using podman version: 3.4.4
podman-composer version 1.0.3

volumes:
      - ./tests/Sql/InitialDbReleaseVersion.sql:/docker-entrypoint-initdb.d/InitialDbReleaseVersion.sql
Error: statfs /tests/Sql/InitialDbReleaseVersion.sql: no such file or directory
exit code: 125   

from podman-compose.

muayyad-alsadi avatar muayyad-alsadi commented on August 16, 2024

please try podman v4 on mac
there are reports regarding volumes on mac and v4 solved it.

from podman-compose.

matheussouza9 avatar matheussouza9 commented on August 16, 2024

@toanvo288 I'm stuck on the same problem. I found this article that mounts a host dir to the qemu vm using ssh reverse proxy combined with sshfs, but, in the last step, I'm getting the following error:

[core@localhost ~]$ sshfs -p 10000 [email protected]:/Users /mnt/Users
connect_to 127.0.0.1 port 22: failed.
read: Connection reset by peer

from podman-compose.

matheussouza9 avatar matheussouza9 commented on August 16, 2024

@muayyad-alsadi unfortunately Podman v4 is not available on brew yet. Homebrew/homebrew-core#95318 (comment)

from podman-compose.

viinhpham avatar viinhpham commented on August 16, 2024

@toanvo288 I'm stuck on the same problem. I found this article that mounts a host dir to the qemu vm using ssh reverse proxy combined with sshfs, but, in the last step, I'm getting the following error:

[core@localhost ~]$ sshfs -p 10000 [email protected]:/Users /mnt/Users
connect_to 127.0.0.1 port 22: failed.
read: Connection reset by peer

@matheussouza9
I resolved this by:
sshfs your-username@your-current-local-ip:absolute-path-to-your-local-project-folder your-mounted-forder -o allow_other,uid=1000,gid=1000`

*Note: Don't use 127.0.0.1, You can use your host LAN ip address

from podman-compose.

viinhpham avatar viinhpham commented on August 16, 2024

Hi there, I using MacOS version Monterey. The volumes tag in compose file does not work at all. Noted: I have used PostgreSQL image from docker.io using podman version: 3.4.4 podman-composer version 1.0.3

volumes:
      - ./tests/Sql/InitialDbReleaseVersion.sql:/docker-entrypoint-initdb.d/InitialDbReleaseVersion.sql
Error: statfs /tests/Sql/InitialDbReleaseVersion.sql: no such file or directory
exit code: 125   

@toanvo288

  • You will need to mount your Mac folder in to podman machine folder by logging in podman machine and run the ssh reverse proxy command:

sshfs your-username@your-current-local-ip:absolute-path-to-your-local-project-folder your-podman-mounted-forder -o allow_other,uid=1000,gid=1000`

from podman-compose.

toanvo288 avatar toanvo288 commented on August 16, 2024

@viinhpham and @matheussouza9 : thanks all. I'll check and verify it again. Hope it works with Podman version 4 without a workaround.

from podman-compose.

lmsurpre avatar lmsurpre commented on August 16, 2024

Hope it works with Podman version 4 without a workaround.

it doesn't

from podman-compose.

drgsn avatar drgsn commented on August 16, 2024

not sure if this happens for windows too, but for mac podman machine starts in a detached state, so it won't be able to access anything from your storage. You need to attach the $HOME to it in order to be able to access volumes

  podman machine stop podman-machine-default
  podman machine rm podman-machine-default
  podman machine init -v $HOME:$HOME
  podman machine start

code stolen from https://stackoverflow.com/questions/69298356/how-to-mount-a-volume-from-a-local-machine-on-podman

from podman-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.