#2. Docker Basics with Hands-On POC

  Рет қаралды 1,412

2DPointTechie

2DPointTechie

Күн бұрын

Docker Installation Guide
Ubuntu:
docs.docker.co...
All Flavors:
docs.docker.co...
========
Basic Docker Commands:
1. Pull docker image:
docker pull IMAGE_NAME
2. Run Docker container:
docker run -it IMAGE_NAME OPTIONAL_COMMANDS
3. Build Docker image:
docker build -t IMAGE_NAME:TAG_NAME .
(Make sure to keep the Dockerfile in the same folder or mention the path)
4. List all running containers:
docker ps
5. List all containers:
docker ps -a
6. Remove a container:
docker rm CONTAINER_ID
7. Remove an image from local image repository:
docker rmi IMAGE_ID
========
Commonly used Dockerfile Directives:
FROM: Inherit Base Image
MAINTAINER: Name and email of maintainer of the image
ENV: Setup Environment variables usable within the container
COPY: Copy files to Containers
USER: Which user runs the container processes
WORKDIR: What's my working directory within container?
EXPOSE: Expose the port where the application runs
VOLUME: Mount Host OS's Filesystem as a mount point within the container
CMD: Run the application within container
========
Directory Structure used in Demo:
docker_test/Dockerfile
docker_test/requirements.txt
docker_test/src/sample_app.py
========
Dockerfile used:
FROM ubuntu
MAINTAINER 2DPointTechie "john.doe@somemail.com"
RUN apt-get update -y
RUN apt-get install python3 -y
RUN apt-get install python3-pip python3-dev -y
WORKDIR /
COPY ./requirements.txt /requirements.txt
RUN pip3 install -r /requirements.txt
COPY . /
EXPOSE 5000
CMD ["python3", "src/sample_app.py"]
========
Sample webapp using flask:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def helloWorld():
return "Hello World"
if _name_ == "__main__":
app.run(host='0.0.0.0')
========
requirements.txt:
flask
========

Пікірлер: 2
@samirsingh108
@samirsingh108 Жыл бұрын
Thank you so much for sharing such detailed information. I could say this the best tutorial video among all DevOps video I have watched . It is really helpful for me. 🙂
@ahp9501
@ahp9501 2 жыл бұрын
Hello, Thank you for your great video. I have a problem during installation (last step). I recieve this error: generic@docker-lab:~/test_docker$ sudo docker run -p5000:5000 helloworld:v1 [sudo] password for generic: File "src/sample_app.py", line 6 return "Hello World" ^ IndentationError: expected an indented block generic@docker-lab:~/test_docker$
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 157 М.
Docker Tutorial for Beginners
50:38
mCoding
Рет қаралды 48 М.
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 17 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 101 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 608 М.
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 45 МЛН
you need to learn Docker RIGHT NOW!! // Docker Containers 101
23:19
NetworkChuck
Рет қаралды 2,7 МЛН
#3. Kubernetes Basics #1 | POD and Replicaset
26:21
2DPointTechie
Рет қаралды 477
Docker Crash Course for Absolute Beginners [NEW]
1:07:39
TechWorld with Nana
Рет қаралды 1,8 МЛН
Docker Tutorial for Beginners
56:04
Programming with Mosh
Рет қаралды 2,6 МЛН
you need to learn Kubernetes RIGHT NOW!!
29:34
NetworkChuck
Рет қаралды 1,2 МЛН
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 456 М.
18 Weird and Wonderful ways I use Docker
26:18
NetworkChuck
Рет қаралды 291 М.
Kubernetes 101 workshop - complete hands-on
3:56:03
Kubesimplify
Рет қаралды 1,6 МЛН
Day 1/40 - Docker Tutorial For Beginners - Docker Fundamentals - CKA Full Course 2024
25:22
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 17 МЛН