Jelajahi Sumber

add Dockerfile

larry1chan@qq.com 1 tahun lalu
induk
melakukan
43a710a1f4

+ 0 - 76
bak_all_vol.sh

@@ -1,76 +0,0 @@
-#!/bin/bash
-
-# Variables
-BACKUP_DIR="./testbak"  # Change this to your desired backup directory
-TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
-
-# List of volumes to backup
-#VOLUMES=("nc202501_redis" "nc202501_oo_data" "nc202501_es_root" "nc202501_es_index" "nc202501_db" "nc202501_clamav")  # Replace with your volume names
-VOLUMES=("nc202501_redis" "nc202501_oo_data" "nc202501_es_root"  "nc202501_clamav")  # Replace with your volume names
-
-# Ensure backup directory exists
-mkdir -p "$BACKUP_DIR"
-
-# Function to check if a volume is empty
-is_volume_empty() {
-  local volume_name=$1
-
-  # Use a temporary container to check if the volume is empty
-  if docker run --rm -v "$volume_name:/volume" alpine sh -c '[ -z "$(ls -A /volume)" ]'; then
-    return 0  # Volume is empty
-  else
-    return 1  # Volume is not empty
-  fi
-}
-
-
-# Function to get the next sequence number for a volume
-get_next_sequence_number() {
-  local volume_name=$1
-  local sequence=1
-
-  # Find the highest sequence number for the volume
-  while [ -f "$BACKUP_DIR/${volume_name}_backup_$(printf "%04d" $sequence)_*.tar.bz2" ]; do  
-    sequence=$((sequence + 1))
-  done
-
-  echo "$sequence"
-}
-
-# Loop through each volume and perform the backup
-for volume in "${VOLUMES[@]}"; do
-
-  # Check if the volume is empty
-  if is_volume_empty "$volume"; then
-    echo "Skipping empty volume: $volume"
-    continue
-  fi
-
-  # Get the next sequence number for this volume
-  sequence=$(get_next_sequence_number "$volume")
-
-  # Define the backup file name
-  
-  BACKUP_FILE="$BACKUP_DIR/${volume}_backup-$(printf "%04d" $sequence)_${TIMESTAMP}.tar.bz2"
-  # Create a temporary container to backup the volume
-  echo "Backing up volume: $volume to $BACKUP_FILE"
-  # docker run --rm \
-  #  -v "$BACKUP_DIR:/backup" \
-  #  -v "$volume:/volume" \
-  #  alpine tar czf "/backup/${volume}_backup_${sequence}_${TIMESTAMP}.tar.bz2" -C / volume
-#  echo docker run --rm -v $volume:/volume -v $BACKUP_DIR:/backup" --rm loomchild/volume-backup  backup -v ${volume}_backup-$(printf "%04d" $sequence)_${TIMESTAMP}" 
-  docker run -v "$volume:/volume" -v "$BACKUP_DIR:/backup" --rm loomchild/volume-backup  backup -v ${volume}_backup-$(printf "%04d" $sequence)_${TIMESTAMP} 
-
-
-
-  # Check if the backup was successful
-  if [ $? -eq 0 ]; then
-    echo "Backup completed successfully: $BACKUP_FILE"
-  else
-    echo "Backup failed for volume: $volume!"
-    exit 1
-  fi
-done
-
-echo "All backups completed successfully!"
-

+ 1 - 1
bak_all_vol2.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # Variables
-BACKUP_DIR="./testbak"  # Change this to your desired backup directory
+BACKUP_DIR="/media/orbitzs/nextcloud_files/backup/nc2/docker_volumes"  # Change this to your desired backup directory
 TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
 
 # List of volumes to backup

+ 7 - 0
build/elasticsearch-ingest/Dockerfile

@@ -0,0 +1,7 @@
+FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.23
+
+# Disable Elasticsearch security
+RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
+
+# Install the ingest-attachment plugin
+RUN bin/elasticsearch-plugin install --batch ingest-attachment

+ 23 - 0
build/elasticsearch-ingest/readme.md

@@ -0,0 +1,23 @@
+Here's a Dockerfile that meets your requirements:
+
+```Dockerfile
+FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.23
+
+# Disable Elasticsearch security
+RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml
+
+# Install the ingest-attachment plugin
+RUN bin/elasticsearch-plugin install --batch ingest-attachment
+```
+
+This Dockerfile will:
+1. Use the official Elasticsearch 7.17.23 image as the base
+2. Append "xpack.security.enabled: false" to the elasticsearch.yml configuration file
+3. Install the ingest-attachment plugin in non-interactive mode using the --batch flag
+
+To build and use this image:
+1. Save the Dockerfile
+2. Run `docker build -t elasticsearch-ingest .`
+3. Start a container with `docker run -p 9200:9200 -p 9300:9300 elasticsearch-ingest`
+
+Note: The `--batch` flag is used to ensure the plugin installation runs in non-interactive mode, which is necessary for automated builds. The security configuration is appended to the existing elasticsearch.yml file that comes with the base image.

+ 0 - 0
Dockerfile → build/nextcloud-ffmpeg/Dockerfile