diff --git a/DockerNotes-16-17thNOv b/DockerNotes-16-17thNOv index 6e6d0ce..80c2286 100644 --- a/DockerNotes-16-17thNOv +++ b/DockerNotes-16-17thNOv @@ -282,6 +282,8 @@ on the container directory # docker run -d --name web -v /root/ecomm/:/usr/local/apache2/htdocs/ httpd +docker run --name myecomm -d -P -v /root/ecomm:/usr/local/apache2/htdocs/ httpd + Step 3: we should also be able to access the contaienr from brower, so what option will you give in the command diff --git a/DockerNotes/Notes b/DockerNotes/Notes index b243af4..2d73af7 100644 --- a/DockerNotes/Notes +++ b/DockerNotes/Notes @@ -257,6 +257,19 @@ once container is created you cannot do volume mapping DOCKER FILE ***************************************** + +FROM ubuntu +RUN apt-get update +RUN apt-get install git -y +COPY copy.txt /tmp +ADD compress.tar.gz /tmp +[ec2-user@DOCKERHOST mydockerfiles]$ vim copy.txt +[ec2-user@DOCKERHOST mydockerfiles]$ [ec2-user@DOCKERHOST mydockerfiles]$ touch compress.txt +[ec2-user@DOCKERHOST mydockerfiles]$ ls +compress.txt copy.txt Dockerfile +[ec2-user@DOCKERHOST mydockerfiles]$ tar -czvf compress.tar.gz compress.txt + + Creating our own Images: 2 ways: diff --git a/Kubernetes/Notes b/Kubernetes/Notes index 57890f7..bc46dd0 100644 --- a/Kubernetes/Notes +++ b/Kubernetes/Notes @@ -29,11 +29,46 @@ spec: kubectl get pods -l app=frontend For pod and container logs: + + -------------------------------------------------------------- + vim replicasetdemo.yaml +--- + apiVersion: apps/v1 + kind: Replicaset + metadata: + name: daniel + spec: + replicas:3 + selector: + matchlabels: + type:webserver + template: + metadata: + name:mypod + labels: + author:dan + type:webserver + spec: + containers: + name: c1 + image: nginx + ... + + kubectl create -f replicasetdemo.yaml + kubectl get all + kubectl get pod -l type=webserver + kubectl scale replicaset nameofreplicaset --replicas=5 + + + ---------------------------------------------------------------------- + kubectl describe pod pod1 | less kubectl logs pod1 kubectl logs -f pod1 kubectl logs -f pod1 -c c1 + kubectl delete pods -l env=QA + kubectl describe service serviceName