GithubHelp home page GithubHelp logo

docker's Introduction

Docker core Concepts

Basics

Containers: Isolated "boxes" that contain our code and the environment needed to run it. 1 container must be focused in only 1 task. Images: Created by docker files. They contain the code and the envidonment. They are the blueprint of the container and are readonly

Basic commands

  1. Build an Image docker build -t <NAME:TAG> <path of dockerfile>
  2. Run a container based on a remote or local storage docker run --name <name> --rm -d <IMAGE> --rm => remove after stopping; -d detached mode
  3. Push and pull to docker hub docker push <REPOSITORY/NAME:TAG> docker pull <REPOSITORY/NAME:TAG>

Bind Mounts & Volumes

Bind Mounts: Used to connect to host machine folders -v /local/path:/container/path

Volume: Used to persist the data -v NAME:/container/path

Networks and Container communication

Create a docker network: Using a network, containers can communicate with each other.

Docker-compose

Allows to pre-define the build and run steps in a .yaml file. It is specially helpful in multiple containers project.

To call this file I use in the .yaml path the command docker-compose up. To stop the services I use docker-compose down

Deploy considerations

  • Replace Bind Mounts with Volumes or COPY
  • Multiple containers might need multiple hosts
  • Multi-stage Builds help with apps that need a build step
  • Control : EC2 remote server, install Docker and run containers.
  • Ease-of-use: ECS managed server, write the commands in AWS

Kubernetes

Is a open-source system for orchestrating container deployments. It helps with Automatic Deployment, Scaling & load balancing and Management Kubernetes Architecture and concepts Worker Node

Core Concepts:

  • Cluster: Set of Node machines which are running Containerized.
  • Nodes: Physical or virtual machine which hosts one or multiple Pods and communicates with the Cluster
    • Master Node: Control Plane of the cluster. It manages the pods across Worker nodes
    • Worker Node: Machines Hosting Pods and running app containers
  • Pods: Application Containers + needed Resources (for example Volumes)
  • Containers: Regular Docker Containers
  • Services: A Logical set of Pods with a unique Pod - / Continer- independent IP adress

Installation

  1. Install chocolatey
  2. in Docker Desktop enable kubernetes or run in CMD choco install kubernetes-cli
  3. in CMD run choco install minikube
  4. If I want to have a virtualbox (with docker I dont need) install virtualbox
  5. To run the minikube in CMD run minikube start --driver=docker
  6. Run minikube status to check if the minikube is runing or minikube delete to delete the virtual machine
  7. Run minikube dashboard to open a tab with the cubernetes information in the browser

Kubernetes Objects

Can be declared imperatively or declaratively

Pod Object

Runs one or more containers and contain shared resources (volumes). They have a cluster-internal IP. They loose all the data when they are stopped (like containers)

Deployment Object

Controls one or multiple Pods

docker's People

Contributors

gabrielmoris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.