Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume path parsing seems broken #222

Closed
pkarakal opened this issue Jul 23, 2020 · 8 comments
Closed

Volume path parsing seems broken #222

pkarakal opened this issue Jul 23, 2020 · 8 comments

Comments

@pkarakal
Copy link

In the docker-compose.yml, under the volumes I have the following

volumes:
      - ./environment/configuration/app.json:/usr/share/nginx/html/assets/config/app.json

When running podman-compose up I see that the path of the volume gets tangled up and instead of getting $(pwd)/environment/configuration/app.json, I see $(pwd)/./environment/configuration/app.json and this way the container cannot cannot start.

Environment

OS/Distro: Fedora 32
Podman version:

podman --version
podman version 2.0.2

podman-compose version:

Name         : podman-compose
Version      : 0.1.5

Maybe it's something worth taking a look into.
When running docker-compose up it seems to start the container just fine.

@elmariachi111
Copy link

what happens when you add a :Z at the end?

volumes:
      - ./environment/configuration/app.json:/usr/share/nginx/html/assets/config/app.json:Z

?

@pkarakal
Copy link
Author

what happens when you add a :Z at the end?

volumes:
      - ./environment/configuration/app.json:/usr/share/nginx/html/assets/config/app.json:Z

?

@elmariachi111 I don't see any change. This still does the same thing when parsing the volume path unfortunately.

@pkarakal
Copy link
Author

pkarakal commented Aug 6, 2020

replacing the ./ with ${PWD}/ seems to eliminate the weird parsing.

I also added a bind-propagation parameter ./environment/configuration/app.json:/usr/share/nginx/html/assets/config/app.json:rshared and it seems to be fine

@pkarakal pkarakal closed this as completed Aug 6, 2020
@JonasKs
Copy link

JonasKs commented Aug 18, 2020

Please don't close the issue because a workaround has been found, when the issue is still valid.

I've encountered the same now, and the fix was indeed replacing ./ with ${PWD}.

@pkarakal pkarakal reopened this Aug 18, 2020
@pkarakal
Copy link
Author

The issue on the code seems to get fixed when using os.path.realpath when parsing the volumes. (This is a TODO here https://github.com/containers/podman-compose/blob/devel/podman_compose.py#L90) .

@muayyad-alsadi
Copy link
Collaborator

would you please confirm that this bug is still there in latest code?

@pkarakal
Copy link
Author

would you please confirm that this bug is still there in latest code?

yeap. The bug still persists. tried it with the latest master branch.

@muayyad-alsadi
Copy link
Collaborator

the following are equivalent and ./ or multiple /// are valid

$(pwd)/environment/configuration/app.json
$(pwd)/./environment/configuration/app.json
$(pwd)/////environment/configuration/app.json

despite that I'll fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants