Skip to content

Instantly share code, notes, and snippets.

@duluca
Last active June 30, 2020 02:20
Show Gist options
  • Save duluca/25de70e41347f38b2283ef90ed69840a to your computer and use it in GitHub Desktop.
Save duluca/25de70e41347f38b2283ef90ed69840a to your computer and use it in GitHub Desktop.
Starting with Docker

What is Docker?

  • Docker is an open platform for developing, shipping, and running applications.
  • Combines a lightweight container virtualization platform with workflows and tooling that help manage and deploy applications.

Why is Containerization Important?

  • Containerization allows for encapsulation of app specific configuration concerns.
  • Encapsulation allows for decoupling of dependencies, so each app can depend on different versions.
  • Simpler dependency management results in a low friction IT environment, less things to learn and break.
  • Low friction allows to ship code faster, test faster, deploy faster, shortening the cycle between writing code and running code.

Benefits for Development

  • Faster code → prod cycle means business value can be demonstrated quicker resulting in a positive feedback loop that inherently reduces waste when developing new features.
  • Code support is cheaper, since containers can be docked/undocked to/from developer machine in seconds.

What are Infrastructure Implications?

  • Containers are small, inherently more secure due to reduced attack surface and sandboxing.
  • Containers are flexible, they can be individually scaled to respond to changes in demand in real-time.
  • Containers are accessible, easily and securely stored and shared in an on-premise Docker registry.
  • Using Docker Enterprise tools, containers can be deployed over a collection of servers, or a datacenter, resulting in a private cloud computing environment.

Benefits for Infrastructure and the Business

  • A private cloud means the infrastructure is decoupled from its individual hardware components, resulting in a resilient, high performance and secure system.
  • A private cloud saves money in optimizing utilization of existing resources and lowering op/maintenance costs dramatically.

Docker Commands Cheatsheet

Build Docker Images

  • docker build . -t [user]/[image_name]
  • docker run -p [port]:[port] [user]/[image_name]
  • docker push [user]/[image_name]  

Using Docker Images

  • docker pull [user]/[image_name]
  • docker run -p [port]:[port] [user]/[image_name]
  • docker start [short_name]
  • docker stop [short_name]  

Managing your Docker Images

  • docker ps
  • docker ps -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment