37. Define, Build and Modify Container Images.
Why ?
Created one application and we want to dockerize the application.
What are the steps if we have to deploy our application manually ?
- Deploy OS
- Update apt repo
- Install dependency using apt
- Install python dependency using pip
- Copy source folder to /opt
- Run web server using flask command.
Docker file with file name = <file-name>
FROM Ubuntu [FROM -> Instruction, Ubuntu->Argument] <---- Install OS
RUN apt-get update <------------ Install Dependencies
RUN apt-get install python
RUN pip install flask
RUN pip install flask-mysql
COPY . /opt/source-code <--- Copy source Code.
ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run <-- Specify Entry Point.
Build docker
docker build <docker-file> -t <TAG>
PUSH Docker
docker push <TAG>
38. Command and Arguments in Docker ( CMD, ENTRYPOINT )
40. Command and Argument in K8