A comprehensive solution for managing Docker containers on Linux systems, including safe shutdown, startup, and monitoring capabilities.
- Safely shuts down Docker containers
- Handles graceful termination of processes
- Supports custom shutdown scripts
- Automated changelog generation
- Comprehensive documentation
- Safe shutdown of Docker containers with proper cleanup
- Automatic container startup on system boot
- Detailed logging of all operations
- Error handling and recovery
- Container status monitoring
- Performance optimization
- Linux operating system
- Docker installed and running
- Bash shell (version 4.0+)
- Root or sudo privileges
- Clone the repository:
git clone https://github.com/PeterVinter/Manage_linux_docker_containers.git
cd Manage_linux_docker_containers
- Make the scripts executable:
chmod +x *.sh
./startup_docker_container.sh
./docker_safe_shutdown.sh
The scripts can be configured by modifying the following variables:
TIMEOUT
: Maximum time to wait for container shutdownLOG_FILE
: Location of log filesCONTAINER_LIST
: List of containers to manage
Logs are stored in:
startup_logs.txt
: Container startup logsshutdowns_logs.txt
: Container shutdown logsshutdowned.txt
: Status of shutdown containers
This repository follows a simplified GitFlow workflow with two main branches:
-
main
: The stable branch containing production-ready code- All releases are tagged from this branch
- Protected branch requiring PR reviews
- Must pass all CI checks before merging
-
develop
: The development branch where features are integrated- All feature branches merge here first
- Contains latest development changes
- Must pass CI checks before merging
-
Feature Development
git checkout develop git checkout -b feature/your-feature # Make your changes git push origin feature/your-feature # Create PR to develop
-
Bug Fixes
git checkout develop git checkout -b fix/bug-description # Fix the bug git push origin fix/bug-description # Create PR to develop
-
Release Process
- Features are merged into
develop
- When ready for release,
develop
is merged intomain
- Release tags are created from
main
- Features are merged into
This project uses GitHub's project management features to track issues, pull requests, and milestones. We follow a structured workflow:
- Issues: Used to track bugs, feature requests, and tasks
- Pull Requests: Follow our contribution guidelines
- Milestones: Group related issues and PRs for releases
- Project Board: Visual kanban board for task tracking
- Automated Changelog: Updates via GitHub Actions on PR merges
Our changelog follows the Keep a Changelog format and is automatically updated when PRs are merged.
This repository uses automated changelog generation through GitHub Actions. When you create a PR:
-
Use conventional commit format in PR titles:
feat:
for new features (increments minor version)fix:
for bug fixes (increments patch version)feat!:
or includeBREAKING CHANGE
for breaking changes (increments major version)docs:
for documentation changesrefactor:
for code changes that neither fix bugs nor add features
-
The workflow will automatically:
- Skip changelog updates for changelog-only PRs
- Create a new changelog entry based on your PR title and description
- Increment version number according to semantic versioning
- Create a new PR with the changelog update
This project uses an automated changelog workflow that:
- Updates CHANGELOG.md when PRs are merged to main
- Follows Semantic Versioning for version numbers:
- Major (X.0.0): Breaking changes (feat! or BREAKING CHANGE)
- Minor (0.X.0): New features (feat)
- Patch (0.0.X): Bug fixes and small changes
- Determines change type from PR title:
feat:
→ Added (new features)fix:
→ Fixed (bug fixes)docs:
→ Documentationrefactor:
→ Changedsecurity:
→ Securityfeat!:
orBREAKING CHANGE
→ Breaking Change
- Creates a new PR with changelog updates
- Follows Keep a Changelog format
For detailed workflow documentation, see GitHub CLI Workflow Guide.
This project uses GitHub Actions for automated releases. The workflow is triggered when a new tag is pushed and includes:
-
Automated Changelog Generation:
- Generates changelog from commit messages
- Includes commit hashes for reference
- Groups changes by type
-
Quality Checks:
- Runs ShellCheck on all scripts
- Validates syntax and best practices
- Ensures code quality before release
-
Release Creation:
- Creates GitHub release automatically
- Includes generated changelog
- Adds feature list and installation instructions
To create a new release:
- Make your changes and commit them:
git add .
git commit -m "feat: your feature description"
- Create and push a new tag:
git tag -a v1.x.x -m "Release description"
git push origin v1.x.x
The workflow will automatically:
- Generate the changelog
- Run quality checks
- Create the release
- Update documentation
Follow the Conventional Commits specification:
feat:
New featuresfix:
Bug fixesdocs:
Documentation changeschore:
Maintenance tasksrefactor:
Code improvementstest:
Test updates
Our project follows a structured branching strategy to maintain code quality and automate changelog updates. Here's how to work with our workflow:
main
: Production-ready codedevelop
: Integration branch for featuresfeature/*
: Individual feature branchesfix/*
: Bug fix branchesdocs/*
: Documentation updates
-
Create Feature Branch
# For new features git checkout develop git pull origin develop git checkout -b feature/your-feature-name # For documentation changes git checkout develop git pull origin develop git checkout -b docs/update-description
-
Make Changes
- Follow commit message conventions:
feat:
for new featuresfix:
for bug fixesdocs:
for documentation!
orBREAKING CHANGE
for breaking changes
Example commit messages:
git commit -m "feat: add new container logging" git commit -m "fix: resolve startup script issue" git commit -m "docs: update workflow guide" git commit -m "feat!: change API response format"
- Follow commit message conventions:
-
Push Changes
git push origin your-branch-name
-
Create Pull Request
- Create PR to
develop
branch - Use descriptive title following commit conventions
- Fill out PR template
- Request review if needed
- Create PR to
-
Merge to Develop
- Ensure CI passes
- Get approvals if required
- Merge using "Merge commit"
-
Release to Main
- Create PR from
develop
tomain
- Our workflow will:
- Auto-increment version based on changes
- Update changelog automatically
- Create release tag
- Create PR from
The changelog is automatically updated through our GitHub Actions workflow. Here's the complete process:
-
Starting Development
# Always start from develop git checkout develop git pull origin develop # Create your feature branch git checkout -b feature/your-feature
-
Making Changes
# Make your changes git add . git commit -m "type: description" git push origin feature/your-feature
-
Pull Request Flow a. Feature to Develop:
- Create PR from your feature branch to develop
- Get review and approval
- Merge to develop
b. Develop to Main:
- Create PR from develop to main
- Get review and approval
- Merge to main
- IMPORTANT: Wait for changelog PR
c. Changelog Update:
- Automatic PR will be created
- Title will be: "docs: update changelog for vX.Y.Z"
- MUST merge this PR before new changes
-
Version Updates The workflow automatically determines version increments:
- Major (X.0.0): Breaking changes
- Minor (x.Y.0): New features
- Patch (x.y.Z): Bug fixes and docs
-
Important Notes
- Never skip waiting for the changelog PR
- Always merge changelog PR before new changes
- Keep PRs focused and single-purpose
- Follow commit message conventions
Example Flow:
# Start new feature
git checkout develop
git pull origin develop
git checkout -b feature/new-feature
# Make changes and commit
git add .
git commit -m "feat: add new feature"
git push origin feature/new-feature
# Create PR to develop and wait for merge
# Create PR to main and wait for merge
# Wait for changelog PR and merge it
# Then start next feature
git checkout develop
git pull origin develop
git checkout -b feature/next-feature
-
Branch Naming
- Features:
feature/descriptive-name
- Fixes:
fix/issue-description
- Docs:
docs/update-topic
- Features:
-
Commit Messages
- Be descriptive but concise
- Follow conventional commits
- Reference issues when applicable
-
PR Guidelines
- One feature/fix per PR
- Keep changes focused
- Update tests if needed
- Include documentation updates
-
Documentation
- Update README for new features
- Keep code comments current
- Update API docs if changed
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any problems or have suggestions, please open an issue.