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

Enabling other container tools then docker #24

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

markaltmann
Copy link

I find this script highly useful. As we are also using other docker cmd capable tools out there, like Podman or Finch, I want to adapt the script to be able to supply a docker/oci capable tool here.

I tested with docker the import export. However the save / load does not yet work, as the output of "$CONTAINER ps -lq" exists only in docker and Podman has others.

Still the base is working.

This supports providing a specific env variable to override the usage of docker. 
Tested with Podman, should also work with finch.
Basically any drop-in replacement of Docker would work
@markaltmann
Copy link
Author

Also I found there was a typo in your latest script @Guiorgy
It was in the fulldirname function.

vackup Show resolved Hide resolved
Podman remove the --latest -l option from their ps call.
Reverting of using just -n 1 for the latest created container.
@markaltmann
Copy link
Author

Any update on the review?
@Guiorgy, @BretFisher

@Guiorgy
Copy link
Contributor

Guiorgy commented Nov 21, 2024

We probably should wait for someone to test this on Finch just in case before considering merging, less we want a repeat of ;& ;P

@markaltmann
Copy link
Author

We probably should wait for someone to test this on Finch just in case before considering merging, less we want a repeat of ;& ;P

I can try this one on finch, have it running as well. I'll need to plan this in, so maybe 1-2 days.

@markaltmann
Copy link
Author

We probably should wait for someone to test this on Finch just in case before considering merging, less we want a repeat of ;& ;P

So, was a bit faster. It does not run nicely, however the error is weird, as it does not read the redlink before it starts a container, it did no occur with Podman, which is strange, as it should have fired an error. Anyway, if I comment out the readlink portion, it complains about relative paths, but as nerdctl can use that, it works:

image

Relevant Script Portion:
image

I will continue to test tomorrow again with Podman. Something seems amiss in the directory resolution of fulldirname().

@markaltmann
Copy link
Author

markaltmann commented Nov 25, 2024

@Guiorgy It seems that the readlink call with option -m is not supported, and it looks like doing it mit -f solves the problem.
https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script

image

However in the latest OSX versions, this seems to be rectified.

readline -m is not recognized, switch to -f seems to work.
/usr/bin bash can on macOS systems usually point to the system shell. As this I quite old, and you have a newer shell, it's better to use the first bash provided in Path, which is mostly newer.
@markaltmann
Copy link
Author

@Guiorgy : I did with the latest version do a test with Finch and Podman on macOS 14.7.1 on a MacBook Pro M1 Pro.
Can you test on a linux system whether it works there with finch and podman as well?

Added Handling instructions and example inside for multi tool usage
@Guiorgy
Copy link
Contributor

Guiorgy commented Nov 25, 2024

From man pages:

  • The -f option found in many implementations was not included, as the realpath utility provides equivalent functionality with a choice of behaviors.
  • The realpath utility was added in preference to a -f option found in some implementations of the readlink utility ...

Can you try realpath instead? Might be better to use that.

Edit: On Linux systems, at the moment, your best bet to canonicalize a path that may contain symbolic links is readlink -f. - StackOverflow user, 2019

Also, please refrain from modifications that fall outside the intent of this PR, like #!/bin/bash -> #!/usr/bin/env bash. Than should be a separate PR, so Bret can choose whether to include a subset of the changes.

Edit:

Can you test on a linux system whether it works there with finch and podman as well?

Not familiar with either, have never used them. I'll try them if I have the time next weekend.

@markaltmann
Copy link
Author

Also, please refrain from modifications that fall outside the intent of this PR, like #!/bin/bash -> #!/usr/bin/env bash. Than should be a separate PR, so Bret can choose whether to include a subset of the changes.

I created a new PR here: #27

@markaltmann
Copy link
Author

markaltmann commented Dec 18, 2024

Any update here?

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

Successfully merging this pull request may close these issues.

2 participants