Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Docker Assignment

1. Five DevOps Concepts

1. Version Control (Git)

Version control is a system that tracks changes in files and allows developers to collaborate. Git helps maintain different versions of code, rollback changes, create branches, and merge work efficiently.

2. CI/CD (Continuous Integration & Continuous Deployment)

CI/CD automates the process of integrating code, running tests, and deploying applications. It reduces manual effort and ensures faster, reliable releases.

3. Containers (Docker)

Docker allows packaging applications with all their dependencies into isolated containers. This ensures consistency across development, testing, and production environments.

4. Cron Jobs

Cron jobs are scheduled tasks in Linux. They allow scripts or commands to run at a specific time automatically—for example, backups, cleanup scripts, scheduled builds, etc.

5. Infrastructure as Code (IaC)

IaC allows managing servers and infrastructure using code instead of manual configuration. Tools like Terraform and Ansible make infrastructure reproducible, testable, and scalable.


2. How I Completed the Assignment

A. Created a Dockerfile

Since the requirement was to show basic Linux operations, I created this simple Dockerfile:

FROM ubuntu:latest

CMD ["bash","-c","ls -l && pwd && whoami"]

This runs three basic Linux commands when the container starts:

  • ls -l → List files with details
  • pwd → Print the current working directory
  • whoami → Show the current user

B. Build the Docker Image

docker build -t docker-assignment .

C. Run the Container

docker run docker-assignment:latest

The output printed:

  • All files inside the container
  • Current directory (/)
  • User (root)

D. Initialize Git and Push to GitHub

git init
git add .
git commit -m "Added Dockerfile with basic Linux commands"
git branch -M main
git remote add origin git@github.com:dhruvinjs/DockerLinuxAssignment.git
git push -u origin main

3. How This Assignment Helped Me Learn DevOps

This assignment helped me understand:

Linux

I practiced basic Linux commands (ls, pwd, whoami) and understood how the container filesystem looks from inside.

Docker

  • Writing a Dockerfile
  • Building an image
  • Running a container
  • Understanding the role of CMD
  • How Ubuntu behaves inside Docker

Git

I learned how to initialize a repository, add files, commit changes, and push code to GitHub.

DevOps Mindset

By combining Git, Docker, and Linux together, I experienced how DevOps brings different technologies into one workflow. It helped me understand packaging, versioning, automation, and reproducibility—important for building real-world systems.


About

Docker Assignment with linux commands

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages