Day 18 - 90daysofdevops: Docker for DevOps Engineers Part 2 - Docker Compose
What id Docker Compose?
Docker Compose is a tool for defining and running multi-container Docker applications. It allows you to manage multiple containers as a single service, simplifying the process of setting up and running complex applications. Docker Compose uses a YAML file to define the services that make up your application, and it provides a set of commands for starting, stopping, and managing those services.
Docker Compose benefits:
The most common Docker Compose commands:
What is YAML?
YAML (YAML Ain't Markup Language) is a human-readable data serialization language commonly used for configuration files. It is often used in conjunction with programming languages, such as Python, Ruby, and JavaScript, to define application settings and data structures. YAML is designed to be easy to read and write, and it uses indentation to determine the structure of data.
YAML: This YAML file defines a configuration object with four properties: name, email, address, and zip. The address property is a nested object that defines the street address, city, state, and zip code.
name: John Doe
email: johndoe@example.com
address:
street: 123 Main Street
city: Anytown
state: CA
zip: 98765
Task-1
Learn how to use the docker-compose.yml file, to set up the environment, configure the services and links between different containers, and also to use environment variables in the docker-compose.yml file.
I'm able to enter into MYSQL database container:
Recommended by LinkedIn
Task 2
Pull a pre-existing Docker image from a public repository (e.g. Docker Hub) and run it on your local machine.
Pulling the image httpd Apache server
usermod -aG docker your_username
# Reboot your machine
🐳🐳Happy Learning!! #90daysofdevops#devops#docker#dockerfile#dockercompose