Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Volume view #251

Open
erikvullings opened this issue Jul 24, 2023 · 1 comment
Open

Feature request: Volume view #251

erikvullings opened this issue Jul 24, 2023 · 1 comment

Comments

@erikvullings
Copy link

When toggling the view, you display containers, services, and images. Could you also show the volumes and allow me to delete them? And perhaps, open them so I can inspect their content (mount them using a temporary alpine container and log into that) and potentially change their content. Also, it would be useful if I could save a volume to a tar/zip file, and vice versa, to unpack it again to a volume.

For example, when working on a project, I have a database that I wish to share. It runs in the swarm and the backup is made to a volume. I would like to share that volume with team members, but this is rather cumbersome to copy its contents, zip it, send it, and put it back in a new volume. See the create_volume.sh script I use for that below. I would be very useful if dockly could assist in this...

#!/bin/bash

# Help function
display_help() {
    echo "Usage: ./create_volume.sh <volume_name> <source_directory>"
    echo ""
    echo "Arguments:"
    echo "  <volume_name>      Name for the Docker volume"
    echo "  <source_directory> Path to the source directory on the host machine (relative or absolute)"
}

# Check if help option is passed
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
    display_help
    exit 0
fi

# Check if at least two arguments are provided
if [ $# -lt 2 ]; then
    echo "Error: Invalid number of arguments"
    display_help
    exit 1
fi

# Arguments
volume_name=$1
source_directory=$2

# Create the volume (skipped if the volume already exists)
docker volume create "$volume_name" >/dev/null

# Create a temporary container to perform the copy
container_id=$(docker create -v "$volume_name:/target" alpine)

# Copy the data from the source directory to the volume using the container
docker cp "$source_directory/." "$container_id:/target"

# Remove the temporary container
docker rm "$container_id" >/dev/null

echo "Data copied successfully to the Docker volume."
@lirantal
Copy link
Owner

Agree this would be a nice feature added :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants