I am new to podman, so please forgive me that I might be asking about the basics.

Today, I decided to migrate forgejo into a container, to harden my “server”. For this, I backed up forgejo using forgejo dump, which gave me a ZIP file. Now I am lost on putting it into the podman container…

Basically, I want to know:

  1. How do I access files inside podman container, especially one created through quadlet? Does the quadlet part make a difference?
  2. How can I restore forgejo backup created by forgejo dump? Despite this being seemingly common task, there seems to be no documentation about how to restore the backup.

I have been struggling a lot with setting it up. Until moments ago, I had great difficulty debugging networking issue from firewall, which was quite exhausting. So I would like to ask help first for this problem. If anyone could give some pointers or help, it would be greatly appreciated!

  • InnerScientist@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    1 day ago

    Firsts look at what volumes are, then look at the Volume= quadlet option and remember that any data not part of a volume is going to be deleted.

    Once you set up a volume you can just copy data inside of it from the host using the path you specified in the Volume and access it inside the container using the target path you specified in the volume.

    If you only want to copy something once then you can use podman cp (though you will still need volumes if your container has any persistent data!)

    • someacntOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      Thanks, I manage to successfully mount the volume on my host! Sadly, it seems like forgejo’s usual version and docker/podman version are quite different, so there are issues arising from that. I guess I have to set things up from ground-up; At least I have a backup of the repositories now.

  • breadsmasher@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 day ago

    Havent used forgejo, but -

    Is the zip file a dump of the filesystem / data / config the application needs?

    You could want to extract that somewhere, and mount the directory into the container.

    https://docs.podman.io/en/latest/markdown/podman-volume-mount.1.html

    so for example you extract to /home/forgejo you would map this to a container in podman

    Stack to help? https://stackoverflow.com/questions/69298356/how-to-mount-a-volume-from-a-local-machine-on-podman/71576242#71576242