- person Penulis:
-
Dimas Maryanto
PT. Tabeldata Informatika
- account_balance_wallet Donasi via:
- Saweria a/n Dimas Maryanto
- lock_open Join Premium Members:
- Udemy.com
-
Daftar Materi
-
1. Pengenalan Docker 8
-
2. Docker Registry 3
-
3. Docker Container CLI 8
-
1. Docker CLI (Command Line Interface)
2. Management Docker Container
3. Management Docker Images
4. Run a command in a running container
5. Expose services to outside using ports
6. Copying files/content between container and filesystem
7. Logging, Inspect, & Resource Usage Statistics Containers
8. Run a Container using Environtment File
-
4. Docker Networks 7
-
5. Docker Volumes 5
-
6. Dockerfile 15
-
1. Build Docker Image Overview
2. Usage docker build
3. FROM Instruction
4. Environtment Replacement
5. Copying Resources
6. Excluding files/directories
7. Label Instruction
8. Execution Instruction
9. CMD vs ENTRYPOINT?
10. Exposing Ports
11. User, Volumes and Working Directory
12. Health Check Instruction
13. Multiple Stage Builds
14. Best practices for writing Dockerfiles
15. Best practices for scanning images
-
7. Study Kasus: Build docker image 14
-
1. Build specific docker image by programming languages
2. Build Docker Image for Java Webapp
3. Build Java Web using maven-docker-plugin
4. Build docker image for spring-boot
5. Springboot - using Environtment
6. Springboot - where data such as files/images we stored?
7. Springboot - Using Database
8. Build docker image for Angular Project
9. Angular - Access Rest API
10. Angular - Proxy to backend
11. Build docker image for PHP
12. Build Docker image for Laravel Framework
13. Laravel - Using Frontend & Rest API
14. Laravel - Using Database
-
8. Docker Compose 19
-
1. Overview of Docker Compose
2. Get started with Docker Compose
3. Overview of docker-compose CLI
4. Compose file specification and syntax
5. Environment variables in Compose
6. Volume in Compose
7. Share data between Containers in Compose
8. Using sshfs for share data in Compose
9. Using NFS for share data in Compose
10. Networking Overview in Compose file
11. Network links in Compose file
12. Specify custom networks in Compose file
13. Dependency between services in Compose file
14. Build docker image using Compose file
15. Using profiles with Compose file
16. Multiple Compose files to Add & Override attribute
17. Example use case of multiple compose files
18. Scale services using compose command
19. Use Compose in production
-
9. Study Kasus: Docker Compose 7
-
10. Docker Context 8
-
11. Study Kasus: Docker for CI 8
-
1. Overview of Study Cases using docker for CI
2. Setup environment for CI using Gitlab & Nexus OSS
3. The `.gitlab-ci.yml` file
4. Pipeline: PHP deployment using Gitlab CI
5. Pipeline: Java Web deployment using Gitlab CI
6. Pipeline: spring-boot deploy with Gitlab CI
7. Pipeline: Angular deploy with Gitlab CI
8. Pipeline: Laravel deploy with Gitlab CI
-
12. Docker Machine 7
-
13. Study Kasus: Ansible for Docker 4
-
14. Docker Swarm
- Materi: belum tersedia...
-
15. Study Kasus: Docker Swarm
- Materi: belum tersedia...
-
16. Docker on Cloud using GCP
- Materi: belum tersedia...
- Lastest Posts
- 09 Apr 23 Working with Deployment object
- 26 Feb 23 Study cases: Microservice apps (...
- 05 Feb 23 Welcome to the Nutanix HCF (Hybr...
- 04 Feb 23 Silabus SRE - Nutanix AHV: Pemul...
- 17 Jan 23 What is Workload Resources?
- 17 Jan 23 Overview Kubernetes Workloads re...
- 15 Jan 23 Getting started with Transaction...
- 14 Jan 23 Overview of Concurrency Control
- 14 Jan 23 Time your practice (part 3)
- 08 Jan 23 Cleanup Data from Table
Networking Overview in Compose file
Hai semuanya di materi kali ini kita akan membahas tentang Networking menggunakan Docker Compose
By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name.
For example, suppose your app is in a directory called myapp, and your docker-compose.yml
looks like this:
When you run docker-compose -p myapp up
, the following happens:
- A network called
myapp_default
is created. - A container is created using
web’s
configuration. It joins the networkmyapp_default
under the name web. - A container is created using
db’s
configuration. It joins the networkmyapp_default
under the name db.
Look like this:
➜ docker docker-compose -f .\09-docker-compose\network\docker-compose.yaml -p myapp up -d
Creating network "myapp_default" with the default driver
Status: Downloaded newer image for postgres:12.6
Creating myapp_webapp_1 ... done
Creating myapp_db_1 ... done
➜ docker docker-compose -f .\09-docker-compose\network\docker-compose.yaml -p myapp ps
Name Command State Ports
----------------------------------------------------------------------------------------------
myapp_db_1 docker-entrypoint.sh postgres Up 0.0.0.0:31432->5432/tcp,:::5432->5432/tcp
myapp_webapp_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:8080->80/tcp,:::80->80/tcp
➜ docker docker network ls -f name=myapp_default
NETWORK ID NAME DRIVER SCOPE
1d8ba9a6b979 myapp_default bridge local
➜ docker docker network inspect myapp_default -f '{{json .Containers}}' | python -m json.tool
{
"06bc1e24abdb11c0fca7fc9660f17b890f5d67b06b9b3970d71839258873dcb4": {
"Name": "myapp_webapp_1",
"EndpointID": "b64417fe1ef6ab57b1ec22b9322fbc097e1b0e4a7a7311a58b46e224a380fecd",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
},
"ae6570375deaf908ff225f2751b9979a1ec3279d9c66680b4715153789805514": {
"Name": "myapp_db_1",
"EndpointID": "c9ac8916797a4166522aad097b7807d6825e4e7bc1c03e8992d67bd3c61cbb1a",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
}
}
Each container can now look up the hostname webapp
or db
and get back the appropriate container’s IP address. For example, web’s application code could connect to the URL postgres://db:5432
and start using the Postgres database.
It is important to note the distinction between HOST_PORT
and CONTAINER_PORT
. In the above example, for db
, the HOST_PORT
is 31432
and the container port is 5432
(postgres default). Networked service-to-service communication uses the CONTAINER_PORT
. When HOST_PORT
is defined, the service is accessible outside the swarm as well.
Within the web container, your connection string to db
would look like postgres://db:5432
, and from the host machine, the connection string would look like postgres://{DOCKER_IP}:31432
.
If you make a configuration change to a service and run docker-compose up
to update it, the old container is removed and the new one joins the network under a different IP address but the same name.
Yuk simak juga videonya,
Dan jika temen-temen belajar hal baru kali ini jangan lupa buat Like, Subcribe, dan Share ke temen kalian. Terimakasih!!!