-
Notifications
You must be signed in to change notification settings - Fork 20
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
Dockerized net8 #78
Dockerized net8 #78
Conversation
26541f5
to
130093c
Compare
Can you elaborate what kind of documentation is needed? (besides the "docker run" command above) |
Little experience to document a Docker app, as well. It should boil down to 3 things - what I normally look for:
Dockerfile: Build: Run: |
Open a terminal and navigate to your project root directory: cd C:\...\scm-backup Then run the Docker build command: docker build -f ./src\/ScmBackup/Dockerfile . --force-rm -t scmbackup:1.8.0 --build-arg BUILD_CONFIGURATION=Debug --label "com.microsoft.created-by=visual-studio" --label "com.microsoft.visual-studio.project-name=ScmBackup" Explanation: |
I am sharing my bash script, which is used to run the backup process. As it's still under development, please use it at your own discretion. #!/bin/bash
# ***********************************************************************************************
# Backup Bitbucket repos using SCM Backup docker image.
# ***********************************************************************************************
#set -x # Enable debugging mode
set -e # Enable exit immediately on error
# Print input variables
echo "Input variables..."
echo ""
# Get current date in YYYY-MM-DD format
CURRENT_DATE=$(date +%Y-%m-%d)
echo "CURRENT DATE: $CURRENT_DATE"
# Get current time in HHMM format without the colon character
CURRENT_TIME=$(date +%H%M)
echo "CURRENT TIME: $CURRENT_TIME"
# Get timestamp as short date and short time
SHORT_DATE_AND_TIME="${CURRENT_DATE}_${CURRENT_TIME}"
echo "SHORT DATE AND TIME: $SHORT_DATE_AND_TIME"
# Get current directory in Windows format
CURRENT_DIR_WIN=$(cygpath -w "$(pwd)")
echo "CURRENT_DIR_WIN: $CURRENT_DIR_WIN"
# Define backup directory path
BACKUP_DIR="${CURRENT_DIR_WIN}\backups\bitbucket_repo_backup_${SHORT_DATE_AND_TIME}"
echo "BACKUP_DIR: $BACKUP_DIR"
# Create the backup directory if it doesn't already exist
mkdir -p "$BACKUP_DIR"
# Run Docker container to perform backup
docker run --rm \
-v "${CURRENT_DIR_WIN}/settings.yml:/app/settings.yml" \
-v "${BACKUP_DIR}:/app/backups" \
scmbackup:1.8.0 || { echo "ERROR: Failed to start Bitbucket backup."; exit 1; } |
Then there is the question if you would like to publicize your Dockerized app and its image. Then you need to use container registry like Docker Hub, GitHub Container Registry, Google Container Registry, or Amazon Elastic Container Registry (ECR). Then, there should be a clear and concise documentation explaining how to use your Dockerized app, which we don't have for the moment. Anyone else? |
docker run --rm
-v "${CURRENT_DIR_WIN}/settings.yml:/app/settings.yml"
-v "${BACKUP_DIR}:/app/backups"
scmbackup:latest || { echo "ERROR: Failed to start Bitbucket backup."; exit 1; }
Documentation needed.