-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add option to convert relative host paths into absolute paths #52
Comments
Podlet does a literal translation when creating quadlet files. If you look at the quadlet docs, in the A |
Ah thanks, I see, but the “location of the unit file” changes, during that setup, which breaks it in my case.
A good idea, however, if the file needs to exist maybe not optimal then? How about an option After all podman does not need a full canonical (real) path (it can have |
What do you think of a
Then the implementation uses something like this with the path-clean crate: use std::{
borrow::Cow,
path::{Path, PathBuf},
};
use path_clean::PathClean;
fn absolute_clean_path(current_dir: &Path, path: &Path) -> PathBuf {
let path: Cow<Path> = if path.is_absolute() {
path.into()
} else {
current_dir.join(path).into()
};
path.clean()
} |
Problem: If not given, podman seems to assume
$HOME/.config/containers/systemd
as your home directory. This is bad if you use any relative paths in your compose file (e.g. I assume).STR
When you read this: Pay attention to the places
./config
appears../config
is a configuration directory with lots of stuff in there, but could be anything (like a file) for the sake.Have this
docker-compose.yml
YAML:Do all the processing chain to get it into a service and try to start it:
$ podlet -f "$HOME/.config/containers/systemd" --install compose docker-compose.yml systemctl --user daemon-reload systemctl --user start service-name systemctl --user status service-name
Debugging
When you look into the log, you'll see (apart from other stuff) this:
Now where does that strange
***/.config/containers/systemd/config
come from?Tip: It has nothing to do with system.
The solution:
***/.config/containers/systemd/config
is our./config
from above, apparently!Somehow the
podman-systemd-generator
or so always assumes$HOME/.config/containers/systemd
as it's home directory.Proposed solution
Always include
WorkingDir=…
with the absolute path to the $PWD when podlet is executed, to make sure it works.Workaround
I guess adding
-w "$PWD"
respectivelyworking_dir: $PWD
should solve it, too.Edit: Ah no
working_dir
seems to be the location inside the container, not the one for podman itself, i.e. when creating volumes.System
Fedora CoreOS v39.20231204.3.3
Misc
AFAIK this should also affect your Readme caddy example, which also uses
./Caddyfile
and./caddy_data
.The text was updated successfully, but these errors were encountered: