diff --git a/Docker Knowledge/Readme.md b/Docker Knowledge/Readme.md index ea64e23c..5d6aa236 100644 --- a/Docker Knowledge/Readme.md +++ b/Docker Knowledge/Readme.md @@ -1,15 +1,17 @@ -## Container +# 🐳Docker Guide +A comprehensive guide to understanding Docker and its various components. +## 🚢Container A _container_ is what we eventually want to run and host in Docker. You can think of it as an isolated machine, or a virtual machine if you prefer. From a conceptual point of view, a _container_ runs inside the Docker host isolated from the other containers and even the host OS. It cannot see the other containers, physical storage, or get incoming connections unless you explicitly state that it can. It contains everything it needs to run: OS, packages, runtimes, files, environment variables, standard input, and output. -## Images +## 🖼️Images Any container that runs is created from an _image_. An image describes everything that is needed to create a container; it is a template for containers. You may create as many containers as needed from a single image. -## Registries +## 📦Registries Images are stored in a _registry_. In the example above, the _app2_ image is used to create two containers. Each container lives its own life, and they both share a common root: their image from the registry. -## Run a Container +## 🚀Run a Container docker run hello-world @@ -20,7 +22,7 @@ Images are stored in a _registry_. In the example above, the _app2_ image is use 4. The _hello-world_ image states that, when started, it should output some text to the console, so this is the text you see as the container is running. 5. The container stopped. -## Container Management Commands +## 📝Container Management Commands You can get help for Docker commands from the command-line itself using the _–help_ switch. @@ -38,7 +40,7 @@ You can get help for Docker commands from the command-line itself using the _– - _docker rm_: deletes a container -## Running a Server Container +## 🌐Running a Server Container Whether you want to host a web application, an API, or a database, you want a container that listens for incoming network connections and is potentially server containers. @@ -55,11 +57,6 @@ To run a server with Docker, follow these steps: ```sh docker logs -You can get specific parts of the logs with options like `--since`, `--until`, or `--tail`. - - ```sh - docker logs --since 10s - 4. **Stop and Remove a Container:** To stop a running container and remove it, use: ```sh docker stop @@ -82,7 +79,7 @@ This maps port 8085 on the host to port 80 in the NGINX container. Access Jenkins at `http://localhost:8088` to complete the setup. -## Creating a Docker Image +## 🏗️Creating a Docker Image 1. **Create a Dockerfile:** - Create a file named `Dockerfile` to define how your image should be built. @@ -103,7 +100,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. ```sh docker run --rm hello -## Docker Registry and Repository +## 🗂️Docker Registry and Repository | Command | Meaning | Syntax | |-------------------------|---------------------------------------------------|-------------------------------------------------------------| | Login to a Registry | This command helps you log in to your Registry. | `docker login`
`docker login localhost:8080` | @@ -112,7 +109,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. | Pulling an Image | This command can be used to download a specific image or set of images. | `docker image pull nginx`
`docker image pull eon01/nginx localhost:5000/myadmin/nginx` | | Pushing an image | This command can be used to push a specific image or set of images. | `docker image push eon01/nginx`
`docker image push eon01/nginx localhost:5000/myadmin/nginx` | -## Running Containers +## 🚢Running Containers | Command | Meaning | Syntax | |-----------------------------------|-------------------------------------------------|------------------------------------------------------------------| | Command to create a container | This command is used to create a container without running | `docker container create -t -i eon01/infinite --name XYZ` | @@ -124,7 +121,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. -## Commands for Starting or Stopping the Container +## 🔄Commands for Starting or Stopping the Container | Command | Meaning | Syntax | |-------------------------------------|-------------------------------------------------|-------------------------------------------| @@ -135,7 +132,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. | Command for unpausing the container | This command is used for unpausing a container in the docker | `docker container unpause nginx` | | Command for Blocking a container | This command is used for blocking a container in the docker | `docker container wait nginx` | -## Commands for Obtaining Container Information +## 🔍Commands for Obtaining Container Information | Command | Meaning | Syntax | |--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------| @@ -151,7 +148,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. | Commands for Inspecting changes to files or directories on a container’s filesystem | This command is used for inspecting changes to files or directories on a container’s filesystem | `docker container diff inf` | -## Commands for Managing Images +## 🖼️Commands for Managing Images | Command | Meaning | Syntax | |--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------| @@ -170,7 +167,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. | Command for image tagging | We can use this command for image tagging | `docker image tag nginx eon01/nginx` | | Command for pushing an image | We can push any image through this command | `docker image push eon01/nginx` | - ## Commands for Networking + ## 🌐Commands for Networking | Command | Meaning | Syntax | |---------------------------------------------------------------|--------------------------------------------------------------------------------------------------|------------------------------------------------------------| | Command for overlay network | This is used to establish a distributed network between many Docker daemon hosts. | `docker network create -d overlay MyOverlayNetwork` | @@ -183,7 +180,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. | Command for Disconnecting a Container from a Network | We can use this command for disconnecting a container from a network | `docker network disconnect MyOverlayNetwork nginx` | -## Commands for Cleaning Docker +## 🧹Commands for Cleaning Docker | Command | Meaning | Syntax | |-------------------------------------------|--------------------------------------------------|----------------------------------------------| @@ -192,7 +189,7 @@ Access Jenkins at `http://localhost:8088` to complete the setup. | Command for Removing all Images | We can remove all the images in Docker by using this command | `docker image rm $(docker image ls -a -q)` | | Command for Clean all | We can use this command for cleaning everything in Docker | `docker system prune -a` | -## Docker Security +## 🔒Docker Security Container images consist of layers and software packages, which are susceptible to vulnerabilities. These vulnerabilities can compromise the security of containers and applications. Docker Scout is a solution for proactively enhancing your software supply chain security. By analyzing your images, Docker Scout compiles an inventory of components, also known as a Software Bill of Materials (SBOM). The SBOM is matched against a continuously updated vulnerability database to pinpoint security weaknesses. @@ -207,76 +204,93 @@ Docker Scout is a standalone service and platform that you can interact with usi | Export vulnerabilities to a SARIF JSON file | `docker scout cves --format sarif --output redis.sarif.json redis` | | Comparing two images | `docker scout compare --to redis:6.0 redis:6-bullseye` | | Displaying the Quick Overview of an Image | `docker scout quickview redis:6.0` | -# Docker Compose +## 🚢Docker Compose Docker Compose is used to run multiple containers as a single service. For example, you can start an application requiring NGNIX and MySQL with one file, without needing to start each container separately. -## Getting Started with Docker Compose +## 🔑Getting Started with Docker Compose This guide covers how to get Docker Compose up and running, and how to create a simple service with MySQL and NGNIX using Docker Compose. -### Installation +### 🛠️Installation + + #### Step 1: Download Docker Compose + + Use the following command to download Docker Compose: - ```sh - curl -L"https://github.com/docker/compose/releases/download/1.10.0-rc2/dockercompose-$(uname -s)-$(uname -m)" -o /home/demo/docker-compose + curl -L"https://github.com/docker/compose/releases/download/1.10.0-rc2/dockercompose-$(uname -s)-$(uname -m)" -o /home/demo/docker-compose + +This command downloads Docker Compose version 1.10.0-rc2 and stores it in the directory `/home/demo/`. -This command downloads Docker Compose version 1.10.0-rc2 and stores it in the directory `/home/demo/`. #### Step 2: Provide Execute Privileges -Give execute privileges to the downloaded file: + + +Give execute privileges to the downloaded file: - ``sh + chmod +x /home/demo/docker-compose -## Step 3: Verify Installation + + +#### Step 3: Verify Installation✅ + + Check the Docker Compose version: - ```sh - docker-compose version -## Creating Your First Docker Compose File -Create a Docker Compose file (YAML format) using a text editor: + docker-compose version + +## 📄Creating Your First Docker Compose File + +Create a Docker Compose file (YAML format) using a text editor: - ```sh sudo vim docker-compose.yml ## Example `docker-compose.yml` - ```yaml + + version: '2' - services: - database: - image: mysql - ports: - - "3306:3306" - environment: - MYSQL_ROOT_PASSWORD: example - web: - image: nginx - ports: - - "80:80" - -- database and web define two services. -- image specifies the Docker Hub image for MySQL and NGNIX. -- ports specifies the ports to be exposed. -- environment sets the necessary environment variables for MySQL. - -#### Running Docker Compose and Verifying Running Containers : + services: + database: + image: mysql + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: example + web: + image: nginx + ports: + - "80:80" + + + + +- database and web define two services. + +- image specifies the Docker Hub image for MySQL and NGNIX. + +- ports specifies the ports to be exposed. + +- environment sets the necessary environment variables for MySQL. + + + +#### 🚀Running Docker Compose and Verifying Running Containers : - ```sh sudo ./docker-compose up docker ps **Thank you for visiting our directory! We're committed to providing valuable resources to make your experience with Docker Knowledge seamless and enjoyable. If you have any questions or need further assistance, please don't hesitate to reach out. Happy containerizing!** -[LinkedIn](https://www.linkedin.com/in/revanth1/) - - + +[LinkedIn](https://www.linkedin.com/in/revanth1/) diff --git a/Official_Website/contributor.js b/Official_Website/contributor.js index b032e8d4..b899b998 100644 --- a/Official_Website/contributor.js +++ b/Official_Website/contributor.js @@ -118,7 +118,7 @@ async function fetchAllContributors() {
Contributor

${name}

-

Open-sourec contributor

+

Open-source contributor