this post was submitted on 12 Oct 2023
0 points (50.0% liked)

Self-Hosted Main

511 readers
1 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

For Example

We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.

Useful Lists

founded 1 year ago
MODERATORS
 

As stated. I stood up about 8 containers using docker desktop. Eventually I realized Portainer would be more useful and they now have an app for iphone. Once I installed it, portainer has "limited access" to my containers because they were created outside of portainer. Is there a way to fix this or do I have to re-build these in Portainer?

If so, I have a few Docker containers that I need database data from that I really don't want to lose. Is there a way to back up the data, and then re-create the same container from a backup in Portainer?

Still new to docker.

top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 year ago

If you have mapped volumes (I hope you do^^) you can either create the containers the same 8with same paths) in portainer or as other suggest it use docker-compose file/syntax for it. But keep in mind that when you rely on portainer, then keep backup of your configs.

As more advanced user I can tell you, that I use docker, docker-compose, docker swarm from cli and have portainer "only for the quick look". But this depends if you are cool with CLI or want to use a UI.

[–] [email protected] 1 points 1 year ago

Dunno if there is a better way, but you could make docker-compose.yml from the existing/running containers: https://www.makeuseof.com/create-docker-compose-files-from-running-docker-containers/ and import those into Portainer.

P.S. I haven't tried this.

[–] [email protected] 1 points 1 year ago

I would spend the time now to get docker-compose files for each of your containers and then you can use the stack feature in Portainer to recreate the containers. You would then have full access. On the flip side, if you decide to move off of Portainer in the future, having those docker compose files are going to allow a much greater flexibility.

It took me a few hours to get docker-compose files created for all my containers, but now it’s so easy to create a new one, I just copy an existing one and change some of the variables around.

[–] [email protected] 1 points 1 year ago

Portainer stores its own version of compose files in a specific place. I believe you can just copy your compose files into that place.

[–] [email protected] 1 points 1 year ago

I would imagine you would have to rebuild them in portainer.

The good news is that portainer allows you to deploy either standalone containers or use docker-compose (portainer calls it stacks). So if you spin up said containers again and they have data paths that you can replicate, you should be able to just move your data over to the correct path on the new container that you have created

(random) Example: docker run -d -p 80:80 -v /some/path/to/content --restart unless-stopped somecompany/someapp:latest

If you were migrating that app you would need to just put the data back into the proper place (/some/path/to/content) for the container to recognize it. It would take some careful file transfers but it is DEFINITELY possible.

The bad news is that I dont know or understand the nature of your containers so im not sure what is needed specifically or where the containers were sourced/compiled from. Databases can be a bit trickier because they can be standalone dbs or they can be deployed with docker-compose alongside other containers as a service. You are going to have to work that bit out.