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

Set WORKDIR /workdir on Docker level #60

Open
abitrolly opened this issue Sep 24, 2024 · 4 comments
Open

Set WORKDIR /workdir on Docker level #60

abitrolly opened this issue Sep 24, 2024 · 4 comments

Comments

@abitrolly
Copy link

/workdir is a more common default working directory. At least whalebrew project uses it as a standard.

It would be nice if it /workdir is default working directory, and mount point for external files.

@tigarmo
Copy link
Collaborator

tigarmo commented Sep 26, 2024

I personally haven't seen /workdir used much as the working directory; more commonly I've seen /app or something inside /usr/local.

Regardless, I don't see much reason to change what we use currently. Do you feel strongly about this?

@abitrolly
Copy link
Author

@tigarmo try this - https://github.com/yakshaveinc/linux/blob/master/bin/runin-podman.sh

runin-podman.sh yakshaveinc/snapcraft:core24

This is only possible, because container uses /workdir convention. So when I have to always open GitHub page to copy paste command to run a container, I feel strongly that containers that need workdir, should have some convention.

I feel nothing wrong if all rocks used /workdir convention https://documentation.ubuntu.com/rockcraft/en/latest/explanation/rocks/#what-sets-rocks-apart

Why not /app? I may want my app to be in the container, but I probably don't want to work in its dir. The same applies to /usr/local. On Fedora I don't even have write access to that, so why I should work in this dir in the container?

Why not some other name dir? Different people may have different opinions what might go into some other name, but if the name is /workdir I guess we all agree that it only WORKDIR can go there.

@lengau
Copy link

lengau commented Sep 30, 2024

Out of curiosity I did a couple of quick GH searches.

I also failed to find much indication that this is a common convention outside of whalebrew.

@abitrolly
Copy link
Author

@lengau most likely /app and /usr images do not require volume mounts for standard operation, which is not the case for snapcraft. If container doesn't use volumes, /app makes a bit more sense for debugging.

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

3 participants