- Creating and configuring a GitHub repository.
- Applying organizational best practices (branching strategy, repository settings).
- Writing a sample
Dockerfileand building the image. - Running and testing the Docker image locally.
- Pushing the tested code and Docker image to GitHub.
1. GitHub Repository Setup
- Sign in to your GitHub account and click New repository.
- Name the repo according to your organization’s naming convention (e.g.,
project-name). - Add a
README.md,.gitignore, and your preferred branch protection rules. - Clone the repo locally:
2. Apply Organizational Best Practices
- Establish a branching strategy (e.g.,
main,develop, feature branches). - Create issue and PR templates under
.github/. - Configure automated workflows or GitHub Actions as needed.
3. Sample Dockerfile and Image Build
Create aDockerfile in the project root:
4. Local Testing of Docker Image
Run the container and verify functionality:| Task | Command |
|---|---|
| Build image | docker build -t project-sample:latest . |
| Run container | docker run -d -p 8080:80 project-sample:latest |
| Health check | curl http://localhost:8080/health |
5. Push to GitHub
- Stage and commit your changes:
- Push to the remote:

Avoid committing sensitive information (credentials, tokens) to the repository. Use GitHub Secrets for secure storage.