mirror of
https://github.com/Gurkengewuerz/nitro-docker.git
synced 2024-11-26 17:50:52 +01:00
Gurkengewuerz
5e5bf8b70e
- pin commits to keep compatibility - add backup container for database - patch arcturus permission system - add default permission groups - add script for exporting and saving build images
21 lines
668 B
Bash
21 lines
668 B
Bash
#!/bin/bash
|
|
|
|
# Get a list of all service names defined in the Docker Compose file
|
|
SERVICES=$(docker compose config --services)
|
|
|
|
mkdir -p export/
|
|
|
|
# Loop through each service and export it as a tar archive
|
|
for SERVICE in $SERVICES; do
|
|
# Get the container ID of the running service
|
|
CONTAINER_ID=$(docker compose ps -q $SERVICE)
|
|
|
|
echo "$SERVICE: $CONTAINER_ID"
|
|
if [ -n "$CONTAINER_ID" ]; then
|
|
# Export the container as a tar archive
|
|
docker export $CONTAINER_ID > export/${SERVICE}_exported.tar
|
|
echo "Container $SERVICE exported successfully."
|
|
else
|
|
echo "Container $SERVICE is not running or does not exist."
|
|
fi
|
|
done |