- 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
Network links in Compose file
Hai semuanya, di materi kali ini kita akan membahas legacy network di docker yaitu menggunakan links pada compose file.
Links allow you to define extra aliases by which a service is reachable from another service. They are not required to enable services to communicate - by default, any service can reach any other service at that service’s name. In the following example, db
is reachable from web
at the hostnames db
and database
:
Sekarang kita coba jalankan maka hasilnya seperti berikut:
➜ docker docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link up -d
Creating network "link_default" with the default driver
Creating volume "link_mysql_data" with default driver
Creating link_mysql_1 ... done
Creating link_wordpress_1 ... done
➜ docker docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link ps
Name Command State Ports
------------------------------------------------------------------------------------------------
link_mysql_1 docker-entrypoint.sh mysqld Up 3306/tcp, 33060/tcp
link_wordpress_1 docker-entrypoint.sh apach ... Up 0.0.0.0:8080->80/tcp,:::8080->80/tcp
➜ docker docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link logs wordpress
Attaching to link_wordpress_1
wordpress_1 | WordPress not found in /var/www/html - copying now...
wordpress_1 | Complete! WordPress has been successfully copied to /var/www/html
wordpress_1 | No 'wp-config.php' found in /var/www/html, but 'WORDPRESS_...' variables supplied; copying
'wp-config-docker.php' (WORDPRESS_DB_HOST WORDPRESS_DB_NAME WORDPRESS_DB_PASSWORD WORDPRESS_DB_USER)
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, u
sing 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, u
sing 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
wordpress_1 | [Mon Aug 23 20:35:12.754365 2021] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.48 (Deb
ian) PHP/7.4.22 configured -- resuming normal operations
wordpress_1 | [Mon Aug 23 20:35:12.754459 2021] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D
FOREGROUND'
➜ docker docker network ls -f name=link*
NETWORK ID NAME DRIVER SCOPE
f93145728402 link_default bridge local
➜ docker docker container inspect $(docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link ps -q) -f '{{.Name}} => {{json .NetworkSettings.Networks.link_default.Links}}'
/link_mysql_1 => null
/link_wordpress_1 =>
["link_mysql_1:db",
"link_mysql_1:link_mysql_1",
"link_mysql_1:mysql_1"]
➜ docker docker container inspect $(docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link ps -q) -f '{{.Name}} => {{json .Config.Env}}'
/link_mysql_1 =>
["MYSQL_DATABASE=wordpress_db",
"MYSQL_USER=wordpress_user",
"MYSQL_PASSWORD=wordpress_user",
"MYSQL_ROOT_PASSWORD=secretPassword"]
/link_wordpress_1 =>
[ "WORDPRESS_DB_HOST=db",
"WORDPRESS_DB_USER=wordpress_user",
"WORDPRESS_DB_PASSWORD=wordpress_user",
"WORDPRESS_DB_NAME=wordpress_db"]
➜ docker docker container inspect $(docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link ps -q) -f '{{.Name}} => {{json .NetworkSettings.Networks.link_default.Aliases}}'
/link_mysql_1 => ["6db651322822","mysql"]
/link_wordpress_1 => ["wordpress","9a45840e15e0"]
➜ docker docker-compose -f .\09-docker-compose\network\link.docker-compose.yaml -p link exec mysql mysql -u wordpress_user --database wordpress_db -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.7.35 MySQL Community Server (GPL)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
+------------------------+
| Tables_in_wordpress_db |
+------------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_termmeta |
| wp_terms |
| wp_usermeta |
| wp_users |
+------------------------+
12 rows in set (0.00 sec)
mysql> select * from wp_users;
+----+------------+------------------------------------+---------------+-----------------------------+-----------------------+---------------------+---------------------+-------------+--------------+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+----+------------+------------------------------------+---------------+-----------------------------+-----------------------+---------------------+---------------------+-------------+--------------+
| 1 | dimasm93 | $P$BJ61phmiwXQ7dOBacO08nuvIPyFftS1 | dimasm93 | software.dimas_m@icloud.com | http://localhost:8080 | 2021-08-23 20:50:46 | | 0 | dimasm93 |
+----+------------+------------------------------------+---------------+-----------------------------+-----------------------+---------------------+---------------------+-------------+--------------+
1 row in set (0.00 sec)
Sekarang coba buka alamat http://localhost:8080 maka hasilnya seperti berikut:
Yuk simak juga videonya,
Dan jika temen-temen belajar hal baru kali ini jangan lupa buat Like, Subcribe, dan Share ke temen kalian. Terimakasih!!!