- 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
Share data among machines
Hai semuanya, di materi kali ini kita akan membahas tentang share data berbeda machine.
When building fault-tolerant applications, you might need to configure multiple replicas of the same service to have access to the same files.
There are several ways to achieve this when developing your applications. One is to add logic to your application to store files on a cloud object storage system like Amazon S3. Another is to create volumes with a driver that supports writing files to an external storage system like NFS or Amazon S3.
Volume drivers allow you to abstract the underlying storage system from the application logic. For example, if your services use a volume with an NFS driver, you can update the services to use a different driver, as an example to store data in the cloud, without changing the application logic.
Ada beberapa driver yang kita bisa gunakan untuk share data among machine, diantaranya:
- SSH
- NFSv3
- NFSv4
- CIFS/Samba
- dan beberapa plugin network lainnya.
This example assumes that you have two nodes, the first of which is a Docker host and can connect to the second using SSH. On the Docker host, install the vieux/sshfs
plugin:
Create a volume using a volume driver, This example specifies a SSH password, but if the two hosts have shared keys configured, you can omit the password. Each volume driver may have zero or more configurable options, each of which is specified using an -o
flag.
Start a container which creates a volume using a volume driver. This example specifies a SSH password, but if the two hosts have shared keys configured, you can omit the password. Each volume driver may have zero or more configurable options. If the volume driver requires you to pass options, you must use the --mount
flag to mount the volume, rather than -v
.
Jika di jalankan maka hasilnya seperti berikut:
# login to your server volume
➜ ~ ssh dimasm93@192.168.88.100
dimasm93@192.168.88.100\'s password:
Last failed login: Tue Jun 8 04:59:33 WIB 2021 from 192.168.88.254 on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Tue Jun 8 04:16:17 2021 from 192.168.88.254
➜ ~ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.88.100 netmask 255.255.255.0 broadcast 192.168.88.255
inet6 fe80::670f:5a7e:d0f6:e5c7 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:13:91:87 txqueuelen 1000 (Ethernet)
RX packets 6092 bytes 1106981 (1.0 MiB)
RX errors 0 dropped 54 overruns 0 frame 0
TX packets 2667 bytes 304464 (297.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
➜ ~ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
➜ ~ sudo -i
[sudo] password for dimasm93:
[root@docker-vm ~]# useradd --create-home --password testing test
[root@docker-vm ~]# su test
[test@docker-vm ~]$
[root@docker-vm ~]# logout
# back to your host
dimasm93@MSI-z390-pro:~$ docker plugin install --grant-all-permissions vieux/sshfs DEBUG=1
latest: Pulling from vieux/sshfs
Digest: sha256:1d3c3e42c12138da5ef7873b97f7f32cf99fb6edde75fa4f0bcf9ed277855811
52d435ada6a4: Complete
Installed plugin vieux/sshfs
dimasm93@MSI-z390-pro:~$ docker plugin ls
ID NAME DESCRIPTION ENABLED
a9d3673157f2 vieux/sshfs:latest sshFS plugin for Docker true
dimasm93@MSI-z390-pro:~$ docker volume create --driver vieux/sshfs \
> -o sshcmd=test@192.168.88.100:/home/test \
> -o port=22 \
> -o password=testing \
> sshvolume
sshvolume
dimasm93@MSI-z390-pro:~$ docker volume ls
DRIVER VOLUME NAME
vieux/sshfs:latest sshvolume
dimasm93@MSI-z390-pro:~$ docker run --rm -it -u root --workdir /root \
> --mount type=volume,volume-driver=vieux/sshfs,src=sshvolume,target=/root \
> alpine ash
~ # ls
~ # echo "Hai ini dari docker container alpine" > halo.txt
~ # ls
halo.txt
~ # exit
## login ke host volume
dimasm93@MSI-z390-pro:~$ ssh test@192.168.88.100
test@192.168.88.100\'s password:
Last login: Tue Jun 8 05:08:37 2021
[test@docker-vm ~]$ ls
halo.txt
[test@docker-vm ~]$ cat halo.txt
Hai ini dari docker container alpine
[test@docker-vm ~]$ ll
total 4
-rw-r--r--. 1 test test 37 Jun 8 05:13 halo.txt
Yuk simak juga videonya,
Dan jika temen-temen belajar hal baru kali ini jangan lupa buat Like, Subcribe, dan Share ke temen kalian. Terimakasih!!!