-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Automatically run --appimage-extract-and-run when in Docker #912
Comments
Outside Docker:
|
There are strong reasons not to do this:
|
Inside Docker on GitLab CI:
|
After the very intense discussion about this change (you know which I mean) in linuxdeployqt, I need to see some strong arguments why to make this the default after having had to make it a flag in the first place. I'd be very open to promoting this flag in e.g., the FUSE error message, and the help texts. Also, I'd put it in docs.appimage.org. |
It should just "do the right thing". Not even I knew (or want to know) about such details. If running "properly" on Docker is not possible/recommended, then "just do the right thing". I want my tools to have an "autopilot" for everything, that works for 99% of users. |
Indeed I was not happy about this, because I feared that everyone with a broken FUSE setup would not even notice the broken FUSE setup. But if in Docker FUSE is not recommended, then why not "just do" what is optimal for FUSE, without bothering the Docker user? |
The flag works just fine for users, too (of course only once they know). That's not really convincing. |
That's the problem: Users will only learn about the flag once they already run into "problems". Hence it is perceived "problematic" whereas it should be perceived as "it just works"... |
Error messages are never bad. But they become really helpful when adding information how to resolve/work around the issue. |
Error messages where unexpected errors are, yes. |
How about showing a warning that we implicitly "add" |
Something like
would probably be an excellent idea, yes. |
I could live with that. But I still need to see your references re. "recognizing Docker". |
Sorry, I had meant to paste them into the first post. |
Would probably help in cases like this. |
I guess people should just Just make that |
My point is that one should not need to learn and think about such things, it should "just work". Most people want stuff to "just work" with no clue how things work. If you don't like this, you are in good company - Albert Einstein had complained about it as well: https://www.einstein-website.de/z_biography/einstein1930.mp3
English translation:
(Albert Einstein) |
Developers aren't "most people". Developers want to know how things work. After all they are obliged to do so, they are responsible. Your way of thinking is too naive for this world. I also agree the Average Joe user doesn't need to be made aware of the problems. It'd be better, but that's not how the world works. But from developers, I want to expect a little bit of interest and effort. |
Then you probably also expect your bus driver to know how the engine works... ;) |
Another case where the author would have saved time and trouble if we silently ran |
Yet another case where someone did not know how to use |
I'd welcome you to implement #912 (comment) @TheAssassin. It would make AppImages "just work" on Docker. |
You are free to send a PR. I don't see any real reason to change anything. As said, I could live with it, but I don't plan to implement it myself. Even after you turned around 180° and started to accept and encourage the extraction, the error message still doesn't point to this parameter (or the respective environment variable). How about starting there? That change is way smaller, and a lot safer and pretty much as easy to use as anything else. |
I want an error message, discouraging from extracting the AppImage in any situation other than Docker, because in Docker this is the right thing to do. Does this make sense? |
Currently it is manual work to find out why AppImages don't "just work" in Docker and what to do about it. And that is avoidable manual work. |
As said, I do not have the time to fix the runtime to implement your ideas. If you're reluctant to implementing this yourself, consider changing the error message. The only reason it's hard for users to figure out the solution is that the error message doesn't mention |
Key is to have different behavior when we are inside Docker vs. when not. |
I will write this one last time: I don't mind having auto extraction, but I don't have time to implement it, so you either have to wait or you do it yourself. I am not a time wizard! Please stop begging. |
Yes, I get it ;-) |
Tempted to say "at last"... |
I am implementing Docker detection based on the above theory of operation in my experimental Go code for now and if it turns out to work properly there, then we can port it over to C for Edit: Looks like it is working: https://travis-ci.org/probonopd/appstream/jobs/619067924#L4750 Here are the 5 lines of code this took me in Go: |
Please feel free to send a PR to the runtime. |
Does this look about right @TheAssassin?
|
You do not evaluate the return values of
You should not misuse environment variables as global variables IMO. |
Thanks for your review. Especially in the runtime, I am always trying to get away with the fewest lines of code possible.
My line of thought was that the worst thing that can happen is that in case of an error, we won't set
I never know how large a string can get. What value would you put there?
Can you give an example?
I tried to do it in a "minimally invasive" way, with the least potential of introducing additional lines of code, additional variables, and additional complexity. Do you just consider the "misuse" of environment variables bad style or do you see real downsides here? Always happy to learn. |
The focus should IMO be on secure code, not on "short" code.
It's pretty unlikely
There's plenty out on the Internet. They work like their non-
Here it's fine, I guess. We intend to write a new runtime anyway, there we can implement a proper state management. |
In my opinion auto extract should happen everywhere or nowhere. There shouldn't be any special casing of certain environments. What happens when users say "well it worked in Docker... why not here?". You'll just end up with the same problem you have now, but even harder to diagnose! Why make Docker special? Is there any disadvantage to extracting everywhere? The user must already trust the AppImage if they are attempting to run it, and an untrustworthy AppImage could always replace your runtime with a custom one anyway. |
@shoogle that's what I think, too. I wouldn't bind it to Docker. But I've been outvoted it seems. The problem with Docker, as explained, is that there's no FUSE usually for security reasons. |
Yes. Sloppy users might think "oh well, AppImages need to be extracted". Except for situations like Docker we want to force users to fix their FUSE setup rather than accept a half-broken system.
We could print a very clear message to stderr, like
|
What are the advantages of FUSE compared to extracting? (Genuinely curious) |
Think "10 GB game AppImage". Thinking in such extremes make the advantage of mounting abundantly clear. |
Indeed! How about auto extracting if the AppImage is smaller than a certain size (e.g. 20 MB) and not otherwise? That would cover developer apps in Docker and small consumer applications, while excluding bigger apps and games. Naturally, there would be environment variables available for users that always (or never) want to auto extract. This avoid special-casing build environments and works everywhere, not just Docker. Edit: There could even be an envronment variable to set the size limit for auto-extraction. |
@shoogle I think it might be easier to just "mark" AppImages which may be auto-extracted if FUSE is not available with a semi-hidden flag. Our dev tools can be marked that way. That way, we don't bind ourselves to Docker. @probonopd just for clarification (I don't want to support your case), but extracting should be done only when in Docker and when FUSE is not available. Both can be checked. In any case, we can fix this in the short term, as in the long term we'll have a type 3, hopefully. |
What is type 3? Is this your codeword for AppImages that are fully supported by the base system (like |
Hey, just stumbled upon this issue. Is this now a thing? I'm planning to use AppImage but sometimes I need to run it in Docker and I guess extracting the AppImage according to this issue is what is necessary, but it's not the right thing to do in other environments. Is there an example or some more information so I could learn more about that? :-) |
Nothing has been implemented so far. The easiest fix is to follow #912 (comment). |
Setting the APPIMAGE_EXTRA_AND_RUN=1 as ENV allows reusing the target packaging on a non docker environment AppImage/AppImageKit#912 (comment) Contributes to CURA-8640
Just to chime in as well, I spent some few hours trying to get fuse to work since the instructions on the error said to install it, before finding out it's not doable or recommended inside containers. I was about to give up on AppImage until I randomly stumbled upon this thread. Also I'm running inside singularity/apptainer and not docker so Docker autodetect is also in my opinion not the best solution as there are other containers. Maybe switching to extract-and-run when fuse fails would be a good option if it goes along with a warning that you should set the env var if you are inside a container. In any case for me either is a no-go because it's a 2GB AppImage which needs to run every few seconds and extracting seems to take a good while. So I will just move to some other solution. |
It will be nice if |
At first tried installing libfuse as the AppImage error message presents s3fs-fuse/s3fs-fuse#647 (comment) But eventually found out about AppImage/AppImageKit#912 (comment) which is not an optimized solution, but it is preffered instead of providing sys admin privileges to a docker container.
Consistent with our "it should just work" mantra, automatically run --appimage-extract-and-run when in a Docker container
/.dockerenv
exists, and/or/proc/1/cgroup
begins with/lxc/
or/docker/
@TheAssassin re-iterates that one should not enable FUSE for security reasons in Docker containers...
The text was updated successfully, but these errors were encountered: