-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsession12sl.txt
137 lines (103 loc) · 4.11 KB
/
session12sl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
Create Docker Compose file and Install Docker compose
sudo apt update
sudo apt install docker-compose
#Create a file docker-compose.yml
version: '2'
services:
compose-test:
image: centos
links:
- compose-db
command: /usr/bin/curl compose-db:6379
compose-db:
image: redis
expose:
- "6379"
#make sure docker is working
#to check the same
systemctl status docker
systemctl restart docker
# if it fails then create the daemonfile in the below path
nano /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"]
}
or you can also follow below stackoverflow link
https://stackoverflow.com/questions/49110092/failed-to-start-docker-application-container-engine
#and then restart the docker
systemctl restart docker
+++++++++++++++++++++++++++++++
#run the docker comppose up command to upload
sudo docker-compose up
+++++++++++++++++++++++++++++++++++++
1.Public container Registry .2. Private registry (ecr,acr,ghcr)
#Upload a docker image to dockerhub public container registry
#retag the image
docker tag <imagenameid> <dockerhubusername>/<imagename>:tag
docker tag 5d0da3dc9764 niladrimondaldcr/niladricentos:2.0
#retag or create the docker image with below format
<dockerhubusername>/<imagename>:tag
niladrimondaldcr/niladricentos:2.0
#push the image to the dockerhub registry
Login to the docker
root@ip-172-31-25-250:/home/shialmonstar199# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: niladrimondaldcr
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
root@ip-172-31-25-250:/home/shialmonstar199#
#docker push command
docker push niladrimondaldcr/niladricentos:2.0
root@ip-172-31-25-250:/home/shialmonstar199# docker push niladrimondaldcr/niladricentos:2.0
The push refers to repository [docker.io/niladrimondaldcr/niladricentos]
74ddd0ec08fa: Mounted from library/centos
2.0: digest: sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc size: 529
#Upload the image into the private repository
#Pull the docker registry:2 image
root@ip-172-31-25-250:/home/shialmonstar199# docker pull registry:2
2: Pulling from library/registry
ca7dd9ec2225: Pull complete
c41ae7ad2b39: Pull complete
1ed0fc8a6161: Pull complete
21df229223d2: Pull complete
626897ccab21: Pull complete
Digest: sha256:ce14a6258f37702ff3cd92232a6f5b81ace542d9f1631966999e9f7c1ee6ddba
Status: Downloaded newer image for registry:2
docker.io/library/registry:2
root@ip-172-31-25-250:/home/shialmonstar199# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest 2f66aad5324a 47 hours ago 117MB
registry 2 81c944c2288b 3 months ago 24.1MB
centos latest 5d0da3dc9764 17 months ago 231MB
niladrimondaldcr/niladricentos 2.0 5d0da3dc9764 17 months ago 231MB
root@ip-172-31-25-250:/home/shialmonstar199#
#Run a container with registry:2 image
docker run -d -p 5000:5000 --restart=always --name registry registry:2
#i can access the private repository from the localhost rdp
http://localhost:5000/v2/_catalog
#retage the image to push
root@ip-172-31-25-250:~# docker tag 5d0da3dc9764 localhost:5000/niladricentos:2.0
#docker psuh
docker push localhost:5000/niladricentos:2.0
#now browse again to the private repo
http://localhost:5000/v2/_catalog
#Cleanup
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images -q)
++++++++++++++++++++++++++++++++++++++++
Kubernetes:
1. Master
kube-scheduler
etcd (database) (etcd-replica in another region multiple copy)
controller manager
node controller
replicas controler
apiserver
2.worker nodes
kubelet
kube-proxy
pod
docker runtime