Backup Container yaml File

Hi,

I am new to Docker an also new to Portainer. My Questions is, when I have Add a Container, can I save all my Configurations that i have made? So that I can Deploy the Container on an other Docker Host? So that I can start the Container with Docker compose or in an other Portainer. I can´t find something that describe how I can do this.

Best Regards

Frank

Most of the functionality you describe doesn’t yet exist in Portainer but there are feature requests for it on our repo

In the interim, you can look at storing your yml files in git and deploy from them via the stacks view. You can also alternatively make an app template that deploys from these stack files if that’s easier. Video here

#!/bin/sh

# 1. Install git
# sudo apt update
# sudo apt install git
# 2. Optional: change to your docker user folder (mine is "docker1")
# cd /home/docker1
# 3. D/L repo (don't create special folder, git will do it for you)
# sudo git clone https://github.com/Red5d/docker-autocompose.git
# 4. Cnange to created repo folder
# cd home/docker1/docker-autocompose
# 5. Run
# sudo docker build -t red5d/docker-autocompose . (Don't miss dot at the end)

Containers=$(docker ps --no-trunc --format "{{.ID}};{{.Names}}")
Date=$(date +%Y-%m-%d-%H%M)
Path="/volume1/Download/Containers_config/$Date/"

mkdir -p "$Path"
echo "$Containers" | while IFS= read -r line; do
   echo "$line" | while IFS=';' read ID Name; do
          docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose -v 3 "$ID" > "$Path/$Name.yml"
          echo "$ID $Name"
     done
done