2

I created a container with a comprehensive list of volumes, network maps and environment variables.

Is there any way Portainer exports the container configuration or provide a Docker CLI command to create such container?

top 3 comments
sorted by: hot top controversial new old
[-] thekrautboy@alien.top 4 points 1 year ago

https://github.com/Red5d/docker-autocompose

Generates a docker-compose yaml definition from a docker container.

For the future you should get started by using compose files from the beginning, and keep those as your "backup" of the container config. Exporting them from a deployed container is not the intended approach.

[-] CameronDev@programming.dev 1 points 1 year ago* (last edited 1 year ago)

I dont know if it can now, but it definitely couldnt a few years ago, and i havent seen anything for it recently.

When i had the same issue, i tried this:

~~https://www.makeuseof.com/create-docker-compose-files-from-running-docker-containers/~~

Edit: link has a very aggressive anti adblock, but the script is python-autocompose which the other poster has linked.

It didnt work then, just generating a very basic outline, but maybe it has improved.

On the upside, this is a mistake youll only make once, I just use compose for everything now, saves a lot of hassle down the line.

[-] RevolutionaryHunt753@alien.top 1 points 1 year ago

Thank you u/joecool42069 and u/thekrautboy for help.

this post was submitted on 27 Oct 2023
2 points (100.0% liked)

Self-Hosted Main

504 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