title
Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10

description
Dockerfile simply explained. This is a Dockerfile tutorial by example. To deploy your application with Docker it must be packaged to it's own docker container. So, this means a docker image needs to be built from our JavaScript and Nodejs application and prepare it to be deployed on some environment. This will usually be done by an CD like Jenkins. But in this video we will simulate what Jenkins does locally, building a docker image from our application locally. ▬▬▬▬▬▬ T I M E S T A M P S 🐳 0:00 - Intro 1:49 - What is a Dockerfile? 2:22 - How the Dockerfile commands map to the image environment 8:05 - Create the Dockerfile (Demo) 12:00 - Build an image out of the Dockerfile 15:02 - Start the Application to verify: 1) App starts successfully 2) App environment is configured correctly 19:34 - do improvement - copy only relevant files "Docker in Practice": Developing with Docker ► https://youtu.be/6YisG2GcXaw Docker Compose ► https://youtu.be/MVIcrmeV_6c Dockerfile ► https://youtu.be/WmcdMiyqfZs Private Repository ► https://youtu.be/vWSRWpOPHws Deploy your containerized Application ► https://youtu.be/ZowjOhpAcIc You can check out my videos for the Pre-Requisites: ✅ Basic Docker Concepts: https://youtu.be/GeqaTjKMWeY ✅ Basic Commands: https://youtu.be/xGn7cFR3ARU For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible. ►► Full Docker and Kubernetes Tutorial Playlist: https://bit.ly/2YGeRp9 This video is the 10th of a complete series for beginners, where I explain the basic concepts and also show you demo's like deploying your containerized application. At the end of this tutorial you will fully understand Docker and Kubernetes. 💡 Only interested in Docker? ►► Complete Docker Tutorial Playlist: https://bit.ly/2ymJHbX #docker #dockertutorials #devops #techworldwithnana ------------------------------------------------------------------------------------- The complete step-by-step guide to Docker and Kubernetes will include the following content: 🐳 D O C K E R - Container concept - Why docker? (image vs. traditional DevOps) - Install docker on different operating systems - 8 basic commands you need to know - Docker vs. Virtual Machine - Docker in Practice: Overview of whole development process with Docker (development, continuous delivery, deployment) - Develop an application with Docker - Docker Compose - Dockerfile - Private Repository - Deploying your containerized application - Docker Volumes from theory to practice ✵ K U B E R N E T E S - Main Kubernetes components (including Pod, Service, Ingress, Volumes, ConfigMap, Secrets, Deployment, StatefulSet) - Kubernetes architecture for beginners (master, slave nodes & processes) - Understand how does K8s REALLY work? Main Concepts of how to use K8s - Minikube, Kubectl - set up the cluster and connect to it - Kubectl main commands - Demo - Configuration file (YAML) - syntax - Kubernetes Namespaces - Communication between the pods - basic networking concepts in Kubernetes - K8s Deployment in practice - example application deployment (pod + service + Ingress + secret) ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬ Join private Facebook group ► https://bit.ly/32UVSZP Don't forget to subscribe ► https://bit.ly/3mO4jxT DEV ► https://bit.ly/3h2fqiO INSTAGRAM ► https://bit.ly/2F3LXYJ TWITTER ► https://bit.ly/3i54PUB LINKEDIN ► https://bit.ly/3hWOLVT Legal Notice: Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein. This video is not accredited, certified, affiliated with, nor endorsed by Docker, Inc.

detail
{'title': 'Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10', 'heatmap': [{'end': 434.016, 'start': 403.547, 'weight': 0.882}, {'end': 792.11, 'start': 707.012, 'weight': 0.961}], 'summary': 'Learn to deploy javascript applications with docker, build docker images with jenkins, create dockerfiles, stack images, use jenkins for image building and sharing, and optimize docker container file configuration for efficient setup.', 'chapters': [{'end': 277.898, 'segs': [{'end': 85.576, 'src': 'embed', 'start': 10.632, 'weight': 0, 'content': [{'end': 12.553, 'text': "So now let's consider a following scenario.", 'start': 10.632, 'duration': 1.921}, {'end': 19.674, 'text': "You have developed an application feature, you have tested it, and now you're ready to deploy it right to deploy it.", 'start': 12.653, 'duration': 7.021}, {'end': 24.416, 'text': 'Your application should be packaged into its own Docker container.', 'start': 19.955, 'duration': 4.461}, {'end': 31.238, 'text': 'So this means that we are going to build a Docker image from our JavaScript, no,', 'start': 24.696, 'duration': 6.542}, {'end': 35.939, 'text': 'just back in application and prepare it to be deployed on some environment.', 'start': 31.238, 'duration': 4.701}, {'end': 39.641, 'text': 'to review this diagram that we saw at the beginning of the tutorial.', 'start': 36.758, 'duration': 2.883}, {'end': 42.223, 'text': 'So we have developed a JavaScript application.', 'start': 40.021, 'duration': 2.202}, {'end': 45.926, 'text': 'We have used the MongoDB Docker container to use it.', 'start': 42.623, 'duration': 3.303}, {'end': 49.289, 'text': "And now it's time to commit it to the gate.", 'start': 46.286, 'duration': 3.003}, {'end': 55.394, 'text': "Right So in this case, we're going to simulate these steps on the local environment.", 'start': 49.589, 'duration': 5.805}, {'end': 58.857, 'text': "But still, I'm going to show you how these steps actually work.", 'start': 55.815, 'duration': 3.042}, {'end': 64.101, 'text': 'So after commit, you have a continuous integration that runs.', 'start': 60.018, 'duration': 4.083}, {'end': 71.043, 'text': 'So the question is what does actually Jenkins do with this application when it builds the application?', 'start': 64.581, 'duration': 6.462}, {'end': 77.286, 'text': 'So the JavaScript application, using the NPM build, et cetera.', 'start': 71.624, 'duration': 5.662}, {'end': 85.576, 'text': 'it packages it then in a Docker image and then pushes it into a Docker repository.', 'start': 77.286, 'duration': 8.29}], 'summary': 'Developed javascript app packaged into docker image, pushed to docker repository', 'duration': 74.944, 'max_score': 10.632, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs10632.jpg'}, {'end': 158.402, 'src': 'embed', 'start': 132.579, 'weight': 4, 'content': [{'end': 137.141, 'text': "We're going to use a blueprint for building images, which is called a Docker file.", 'start': 132.579, 'duration': 4.562}, {'end': 142.065, 'text': "So let's actually see what is a Docker file and how it actually looks like.", 'start': 138.142, 'duration': 3.923}, {'end': 149.12, 'text': 'So as I mentioned, Dockerfile is a blueprint for creating Docker images.', 'start': 143.379, 'duration': 5.741}, {'end': 152.981, 'text': 'A syntax of a Dockerfile is super simple.', 'start': 150.2, 'duration': 2.781}, {'end': 158.402, 'text': 'So the first line of every Dockerfile is from image.', 'start': 153.421, 'duration': 4.981}], 'summary': 'Using a docker file blueprint to create docker images with a simple syntax.', 'duration': 25.823, 'max_score': 132.579, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs132579.jpg'}, {'end': 286.505, 'src': 'embed', 'start': 260.387, 'weight': 5, 'content': [{'end': 269.693, 'text': "For example, I would say it's better to define the environment of variables externally in a Docker compose file, because if something changes,", 'start': 260.387, 'duration': 9.306}, {'end': 271.874, 'text': 'you can actually override it.', 'start': 269.693, 'duration': 2.181}, {'end': 276.457, 'text': 'You can change the Docker compose file and override it instead of rebuilding the image.', 'start': 272.074, 'duration': 4.383}, {'end': 277.898, 'text': 'But this is an option.', 'start': 276.858, 'duration': 1.04}, {'end': 286.505, 'text': 'So this end command basically would translate to setting the environmental variables inside of the image environment.', 'start': 278.399, 'duration': 8.106}], 'summary': 'Using docker compose allows overriding variables without rebuilding the image.', 'duration': 26.118, 'max_score': 260.387, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs260387.jpg'}], 'start': 10.632, 'title': 'Deploying javascript applications with docker and building docker images with jenkins', 'summary': 'Covers packaging a javascript application into a docker container, including testing and use of mongodb, and explains how jenkins builds a javascript application into a docker image, configuring environmental variables, and pushing it to a docker repository.', 'chapters': [{'end': 58.857, 'start': 10.632, 'title': 'Deploying javascript application with docker', 'summary': 'Explains the process of packaging a javascript application into a docker container for deployment, including testing and the use of mongodb, before committing it to the gate for deployment.', 'duration': 48.225, 'highlights': ['The process involves packaging a JavaScript application into a Docker container for deployment.', 'Testing the application feature is necessary before deploying it, ensuring readiness for deployment.', 'The use of a MongoDB Docker container is part of the deployment process for the JavaScript application.']}, {'end': 277.898, 'start': 60.018, 'title': 'Building docker images with jenkins', 'summary': 'Explains how jenkins builds a javascript application into a docker image, leveraging a dockerfile as a blueprint, and configuring environmental variables within the dockerfile before pushing it to a docker repository.', 'duration': 217.88, 'highlights': ['Packaging JavaScript application into Docker image Jenkins packages the JavaScript application using NPM build into a Docker image and then pushes it into a Docker repository.', 'Building Docker image using Dockerfile The process involves creating a Dockerfile as a blueprint, basing the image on a ready node image, and configuring environmental variables within the Dockerfile.', 'Configuring environmental variables in Dockerfile The Dockerfile provides an alternative method to define environmental variables, allowing for external definition in a Docker compose file, avoiding the need for image rebuilding upon changes.']}], 'duration': 267.266, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs10632.jpg', 'highlights': ['Jenkins packages the JavaScript application using NPM build into a Docker image and then pushes it into a Docker repository.', 'The process involves packaging a JavaScript application into a Docker container for deployment.', 'The use of a MongoDB Docker container is part of the deployment process for the JavaScript application.', 'Testing the application feature is necessary before deploying it, ensuring readiness for deployment.', 'The process involves creating a Dockerfile as a blueprint, basing the image on a ready node image, and configuring environmental variables within the Dockerfile.', 'The Dockerfile provides an alternative method to define environmental variables, allowing for external definition in a Docker compose file, avoiding the need for image rebuilding upon changes.']}, {'end': 491.145, 'segs': [{'end': 306.206, 'src': 'embed', 'start': 278.399, 'weight': 0, 'content': [{'end': 286.505, 'text': 'So this end command basically would translate to setting the environmental variables inside of the image environment.', 'start': 278.399, 'duration': 8.106}, {'end': 288.666, 'text': 'The next one is run.', 'start': 287.625, 'duration': 1.041}, {'end': 298.422, 'text': "So all these capital case words that you see from and run, they're basically part of a syntax of a Docker file.", 'start': 290.259, 'duration': 8.163}, {'end': 303.885, 'text': 'So using the run basically you can execute any kind of Linux commands.', 'start': 298.442, 'duration': 5.443}, {'end': 306.206, 'text': 'So you see make directory.', 'start': 304.165, 'duration': 2.041}], 'summary': 'Docker file syntax includes commands like run to execute linux commands and set environmental variables.', 'duration': 27.807, 'max_score': 278.399, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs278399.jpg'}, {'end': 373.618, 'src': 'embed', 'start': 329.951, 'weight': 2, 'content': [{'end': 335.135, 'text': 'So all this commands that you have in Docker file will apply to the container environment.', 'start': 329.951, 'duration': 5.184}, {'end': 341.94, 'text': 'None of them will be affecting my my host environment or my laptop environment.', 'start': 335.335, 'duration': 6.605}, {'end': 346.484, 'text': "So we've run basically you can execute any Linux commands that you want.", 'start': 342.501, 'duration': 3.983}, {'end': 349.367, 'text': "So that's probably one of the most used ones.", 'start': 347.085, 'duration': 2.282}, {'end': 352.329, 'text': 'And we also have a copy command.', 'start': 350.648, 'duration': 1.681}, {'end': 358.074, 'text': 'Now, you would probably ask I can execute a copy command, a Linux copy command using run.', 'start': 352.79, 'duration': 5.284}, {'end': 359.496, 'text': 'Yes, you could.', 'start': 358.855, 'duration': 0.641}, {'end': 370.465, 'text': 'But the difference here is that, as I said, all these commands in run, for example, they apply to they get executed inside of the container.', 'start': 359.796, 'duration': 10.669}, {'end': 373.618, 'text': 'The copy command that you see here.', 'start': 371.277, 'duration': 2.341}], 'summary': 'Dockerfile commands only apply to container environment, enabling execution of linux commands and copy operations.', 'duration': 43.667, 'max_score': 329.951, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs329951.jpg'}, {'end': 434.016, 'src': 'heatmap', 'start': 403.547, 'weight': 4, 'content': [{'end': 408.65, 'text': 'But I have the files that I want to copy on my host in the last one.', 'start': 403.547, 'duration': 5.103}, {'end': 414.372, 'text': 'So from and CMD or command is always part of Docker file.', 'start': 409.707, 'duration': 4.665}, {'end': 420.059, 'text': 'What command does is basically executes an entry point Linux command.', 'start': 414.492, 'duration': 5.567}, {'end': 425.625, 'text': 'So this line with the command actually translates to node server JS.', 'start': 420.439, 'duration': 5.186}, {'end': 429.089, 'text': 'So remember here, we actually do node server JS.', 'start': 425.925, 'duration': 3.164}, {'end': 430.01, 'text': 'So we execute.', 'start': 429.109, 'duration': 0.901}, {'end': 434.016, 'text': 'So we start a node server with no jazz.', 'start': 430.834, 'duration': 3.182}], 'summary': 'The command in the docker file executes an entry point linux command, starting a node server with no jazz.', 'duration': 30.469, 'max_score': 403.547, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs403547.jpg'}, {'end': 491.145, 'src': 'embed', 'start': 459.454, 'weight': 1, 'content': [{'end': 467.496, 'text': 'Because I could also say run node server is the difference again is that CMD is an entry point command.', 'start': 459.454, 'duration': 8.042}, {'end': 473.737, 'text': 'So you can have multiple run commands with different Linux commands, but CMD is just one.', 'start': 467.616, 'duration': 6.121}, {'end': 480.719, 'text': 'And that marks for Docker file that this is the command that you want to execute as an entry point.', 'start': 474.358, 'duration': 6.361}, {'end': 484.34, 'text': "So that basically runs the server and that's it.", 'start': 481.159, 'duration': 3.181}, {'end': 491.145, 'text': "So now let's actually create the Docker file.", 'start': 488.843, 'duration': 2.302}], 'summary': 'Docker file sets cmd as entry point to run server.', 'duration': 31.691, 'max_score': 459.454, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs459454.jpg'}], 'start': 278.399, 'title': 'Docker file commands', 'summary': "Explains the usage of 'run' and 'copy' commands in a docker file, highlighting their application in the container environment, with an emphasis on 'run' as one of the most used commands, and showcases the usage of commands like copy, cmd, and run, along with the creation of a docker file.", 'chapters': [{'end': 373.618, 'start': 278.399, 'title': 'Understanding docker file commands', 'summary': "Explains the use of 'run' and 'copy' commands in a docker file to execute linux commands and copy files, emphasizing that all commands apply to the container environment and not the host, with 'run' being one of the most used commands.", 'duration': 95.219, 'highlights': ["The 'run' command in a Docker file allows the execution of various Linux commands, with the example of creating a directory inside the container using 'make directory'.", 'Emphasizes that commands in the Docker file only apply to the container environment, ensuring no impact on the host or laptop environment.', "The 'copy' command in a Docker file is distinct from the 'run' command, as it facilitates the copying of files into the container environment."]}, {'end': 491.145, 'start': 373.618, 'title': 'Docker file commands and usage', 'summary': 'Demonstrates the usage of docker file commands such as copy, cmd, and run to execute and copy files within a docker container, with an emphasis on the differences between run and cmd, as well as showcasing the creation of a docker file.', 'duration': 117.527, 'highlights': ['CMD is an entry point command, allowing only one command to be specified in a Docker file, serving as the designated command to execute as an entry point. CMD serves as the entry point command in a Docker file, allowing only one command to be specified, and is used to execute a designated command as an entry point.', 'The usage of COPY command to copy files from the host to the container image, enabling the execution of node server JS within the container. The COPY command enables the copying of files from the host to the container image, facilitating the execution of node server JS within the container.', 'Explanation of the difference between RUN and CMD commands, with emphasis on CMD being an entry point command and allowing only one command to be specified. The difference between RUN and CMD commands is explained, emphasizing that CMD is an entry point command allowing only one command to be specified in a Docker file.']}], 'duration': 212.746, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs278399.jpg', 'highlights': ["The 'run' command in a Docker file allows the execution of various Linux commands, with the example of creating a directory inside the container using 'make directory'.", 'CMD is an entry point command, allowing only one command to be specified in a Docker file, serving as the designated command to execute as an entry point.', "The 'copy' command in a Docker file is distinct from the 'run' command, as it facilitates the copying of files into the container environment.", 'Emphasizes that commands in the Docker file only apply to the container environment, ensuring no impact on the host or laptop environment.', 'The usage of COPY command to copy files from the host to the container image, enabling the execution of node server JS within the container.', 'Explanation of the difference between RUN and CMD commands, with emphasis on CMD being an entry point command and allowing only one command to be specified.']}, {'end': 822.58, 'segs': [{'end': 582.471, 'src': 'embed', 'start': 554.259, 'weight': 0, 'content': [{'end': 562.021, 'text': 'that should actually mean that every Docker image that there is on Docker hub should be built on its own Docker file.', 'start': 554.259, 'duration': 7.762}, {'end': 570.864, 'text': "Right So if we actually go to let's actually look at one of the latest versions, which is 13 minus Alpine.", 'start': 562.061, 'duration': 8.803}, {'end': 572.425, 'text': "And let's click inside.", 'start': 570.964, 'duration': 1.461}, {'end': 578.368, 'text': 'And as you see, this specific image has its own Docker file.', 'start': 573.385, 'duration': 4.983}, {'end': 582.471, 'text': 'And here, as you see, we have the same from that we just saw.', 'start': 578.809, 'duration': 3.662}], 'summary': 'Docker images on docker hub should each have their own dockerfile.', 'duration': 28.212, 'max_score': 554.259, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs554259.jpg'}, {'end': 644.948, 'src': 'embed', 'start': 612.348, 'weight': 2, 'content': [{'end': 613.97, 'text': 'And you have this final command.', 'start': 612.348, 'duration': 1.622}, {'end': 617.372, 'text': "Right So you don't have to understand any of this.", 'start': 614.43, 'duration': 2.942}, {'end': 623.916, 'text': 'I just want to demonstrate that every image is based off another base image.', 'start': 617.512, 'duration': 6.404}, {'end': 635.123, 'text': "Right So in order to actually visually comprehend how this layer stacking works with images, let's consider this simplified visualization.", 'start': 623.996, 'duration': 11.127}, {'end': 644.948, 'text': "So our own image that we're building up with the version one point is going to be based on a note image with a specific version.", 'start': 636.86, 'duration': 8.088}], 'summary': 'Demonstrating layer stacking with images based on a specific version.', 'duration': 32.6, 'max_score': 612.348, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs612348.jpg'}, {'end': 792.11, 'src': 'heatmap', 'start': 663.051, 'weight': 1, 'content': [{'end': 670.917, 'text': 'So Alpine is lightweight base image that we installed node on top of it and then we stole our own application on top of it.', 'start': 663.051, 'duration': 7.866}, {'end': 673.719, 'text': 'And basically this is how all the images are built.', 'start': 671.237, 'duration': 2.482}, {'end': 676.902, 'text': "So now let's go back and complete our Docker file.", 'start': 674.32, 'duration': 2.582}, {'end': 680.604, 'text': 'So we have the from specified.', 'start': 677.482, 'duration': 3.122}, {'end': 683.966, 'text': 'We have the environmental variables specified.', 'start': 681.465, 'duration': 2.501}, {'end': 688.587, 'text': "And in just a second, we're going to actually see these commands in action.", 'start': 684.506, 'duration': 4.081}, {'end': 690.847, 'text': "So let's copy that.", 'start': 688.947, 'duration': 1.9}, {'end': 692.828, 'text': 'And this is also very important.', 'start': 691.047, 'duration': 1.781}, {'end': 696.009, 'text': 'Docker file has to be called exactly like that.', 'start': 693.288, 'duration': 2.721}, {'end': 697.649, 'text': "You can't just give it any name.", 'start': 696.349, 'duration': 1.3}, {'end': 702.891, 'text': 'It is always called Docker file, starting with a capital D.', 'start': 698.169, 'duration': 4.722}, {'end': 703.671, 'text': "And that's it.", 'start': 702.891, 'duration': 0.78}, {'end': 704.811, 'text': "It's a simple text file.", 'start': 703.731, 'duration': 1.08}, {'end': 706.171, 'text': 'So just save it like this.', 'start': 705.051, 'duration': 1.12}, {'end': 711.753, 'text': 'And here you even see highlighting and this Docker icon.', 'start': 707.012, 'duration': 4.741}, {'end': 720.157, 'text': "So now that we have a Docker file ready, let's see how to actually use it.", 'start': 716.395, 'duration': 3.762}, {'end': 730.342, 'text': 'So how do we build an image out of it? So in order to build an image using Docker file, we have to provide two parameters.', 'start': 720.317, 'duration': 10.025}, {'end': 738.046, 'text': 'One is we want to give our image a name in the tech, just like all the other images have.', 'start': 732.603, 'duration': 5.443}, {'end': 742.028, 'text': 'So we are going to do it using minus T.', 'start': 738.586, 'duration': 3.442}, {'end': 748.972, 'text': "So we're going to call our image my app and we're going to give it a take of one point zero.", 'start': 742.028, 'duration': 6.944}, {'end': 750.713, 'text': 'The tech could be anything.', 'start': 749.332, 'duration': 1.381}, {'end': 752.834, 'text': 'You can even call it actually version one.', 'start': 750.753, 'duration': 2.081}, {'end': 753.935, 'text': 'It would matter.', 'start': 753.114, 'duration': 0.821}, {'end': 756.336, 'text': "So we're going to do one point.", 'start': 755.215, 'duration': 1.121}, {'end': 765.162, 'text': 'zero and the second required parameter actually is a location of a Docker file,', 'start': 757.938, 'duration': 7.224}, {'end': 770.586, 'text': 'because we want to tell Docker here build an image using this Docker file.', 'start': 765.162, 'duration': 5.424}, {'end': 777.29, 'text': "And in this case, because we're in the same folder as the Docker file, we're just going to say current directory.", 'start': 770.626, 'duration': 6.664}, {'end': 785.795, 'text': "When we execute this, we're going to see that image is built and this is an idea of the image that was built.", 'start': 777.85, 'duration': 7.945}, {'end': 792.11, 'text': 'because I already have note 13 Alpine on my laptop.', 'start': 788.168, 'duration': 3.942}], 'summary': "Using alpine base image, built docker image 'my app' with tag '1.0' and executed successfully.", 'duration': 78.977, 'max_score': 663.051, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs663051.jpg'}, {'end': 822.58, 'src': 'embed', 'start': 797.992, 'weight': 6, 'content': [{'end': 803.555, 'text': "If it's the first time, you will actually see that it's pulling node image from the Docker hub.", 'start': 797.992, 'duration': 5.563}, {'end': 810.198, 'text': 'So now with the Docker images, I can actually see that my image is here.', 'start': 804.255, 'duration': 5.943}, {'end': 812.51, 'text': 'It says created two days ago.', 'start': 811.089, 'duration': 1.421}, {'end': 814.512, 'text': "I don't know why, but anyways.", 'start': 812.611, 'duration': 1.901}, {'end': 822.58, 'text': 'So I have the image name, which is this one here, and I have the name of the image and the tag of the image.', 'start': 814.953, 'duration': 7.627}], 'summary': 'The docker image was pulled from the hub, created two days ago.', 'duration': 24.588, 'max_score': 797.992, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs797992.jpg'}], 'start': 491.705, 'title': 'Dockerfile creation and image stacking', 'summary': 'Discusses creating a dockerfile for a specific base image, emphasizing the importance of individual dockerfiles, and explains the layer stacking process. it also covers building a docker image using alpine as the base, installing node.js, specifying build parameters, and providing insights into docker file naming and location, along with resulting image details.', 'chapters': [{'end': 635.123, 'start': 491.705, 'title': 'Creating dockerfile and understanding image stacking', 'summary': 'Discusses creating a dockerfile for a specific base image, highlighting the importance of each docker image having its own dockerfile and the layer stacking process for images.', 'duration': 143.418, 'highlights': ['The importance of every Docker image having its own Dockerfile is emphasized, demonstrating that the Dockerfile is a blueprint for every Docker image and that every image on Docker Hub should be built on its own Dockerfile.', 'The specific example of the 13-Alpine image having its own Dockerfile is used to illustrate the concept, showing the base image, environmental variables, Linux commands, entry point, and final command.', 'The chapter explains the layer stacking process for images, emphasizing that every image is based off another base image and visually demonstrating the simplified visualization of layer stacking for images.']}, {'end': 822.58, 'start': 636.86, 'title': 'Building docker image with alpine base', 'summary': 'Explains the process of building a docker image using alpine as the base image and node.js installed on top of it, specifying the parameters required to build the image, and providing insights into the naming and location of the docker file, along with the resulting image details.', 'duration': 185.72, 'highlights': ['The chapter explains the process of building a Docker image using Alpine as the base image and Node.js installed on top of it. Alpine base image with the version three point ten, installing Node.js, and building the application on top of it.', "Specifying the parameters required to build the image, including giving the image a name and tag, and providing the location of the Docker file. Providing the image name 'my app' with the tag '1.0' and specifying the location of the Docker file as the current directory.", "Insights into the naming and location of the Docker file, emphasizing that the Docker file has to be named 'Dockerfile' and saved as a simple text file. The Docker file must be named 'Dockerfile' and saved as a simple text file, highlighted with 'Docker' icon.", 'Providing details about the resulting image, including its creation date, name, and tag. Details on the resulting image, such as creation date, image name, and tag.']}], 'duration': 330.875, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs491705.jpg', 'highlights': ['Every Docker image should have its own Dockerfile, serving as a blueprint for the image.', "Illustration of 13-Alpine image's Dockerfile, showcasing base image, variables, commands, entry point, and final command.", 'Explanation of layer stacking process for images, emphasizing the base image dependency and visual demonstration of layer stacking.', 'Process of building a Docker image using Alpine as the base and installing Node.js on top of it.', 'Specification of parameters for building the image, including naming, tagging, and Dockerfile location.', "Emphasis on naming the Dockerfile as 'Dockerfile' and saving it as a simple text file.", 'Insights into resulting image details, such as creation date, name, and tag.']}, {'end': 1058.649, 'segs': [{'end': 893.033, 'src': 'embed', 'start': 846.258, 'weight': 0, 'content': [{'end': 851.662, 'text': 'So what Jenkins does is actually it takes the Docker file that we create.', 'start': 846.258, 'duration': 5.404}, {'end': 862.822, 'text': 'So we have to commit the Docker file into the repository with the code and Jenkins will then build a Docker image based on the Docker file.', 'start': 851.823, 'duration': 10.999}, {'end': 866.663, 'text': "And what is an important point here is that usually you don't develop alone.", 'start': 863.242, 'duration': 3.421}, {'end': 867.483, 'text': 'You are in the team.', 'start': 866.703, 'duration': 0.78}, {'end': 874.585, 'text': 'So other people might want to have access to that up to date image of your application that you developed.', 'start': 868.103, 'duration': 6.482}, {'end': 883.687, 'text': 'It could be a test or maybe who wants to pull that image and test it locally or you want that image to be deployed on a development server.', 'start': 874.605, 'duration': 9.082}, {'end': 886.868, 'text': 'Right In order to do that, you have to actually share the image.', 'start': 883.767, 'duration': 3.101}, {'end': 890.771, 'text': 'So it is pushed into a Docker repository.', 'start': 887.848, 'duration': 2.923}, {'end': 893.033, 'text': 'And from there.', 'start': 891.471, 'duration': 1.562}], 'summary': 'Jenkins builds docker image from file, shared via repository for team access.', 'duration': 46.775, 'max_score': 846.258, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs846258.jpg'}, {'end': 996.854, 'src': 'embed', 'start': 919.377, 'weight': 3, 'content': [{'end': 925.359, 'text': "And in this case, I'm not going to specify any other options because we just want to see what's going on inside of the container.", 'start': 919.377, 'duration': 5.982}, {'end': 926.6, 'text': "So I'm just going to run it.", 'start': 925.78, 'duration': 0.82}, {'end': 938.487, 'text': "OK. so the problem is that it can't find the server jazz file, which is actually logical, because we're not telling it to look in the correct directory.", 'start': 928.26, 'duration': 10.227}, {'end': 947.134, 'text': "So since we're copying all the resources in this home slash home slash directory, server jazz is going to be there as well.", 'start': 939.028, 'duration': 8.106}, {'end': 950.779, 'text': 'And this is another topic.', 'start': 948.598, 'duration': 2.181}, {'end': 958.923, 'text': 'Whenever you adjust a Docker file, you have to rebuild an image because the old image cannot be overwritten, so to say.', 'start': 951.219, 'duration': 7.704}, {'end': 963.685, 'text': "So what I'm going to do now is actually I'm going to delete the one that I built.", 'start': 959.523, 'duration': 4.162}, {'end': 966.847, 'text': "So I'm going to I'm going to actually take the image.", 'start': 964.806, 'duration': 2.041}, {'end': 969.248, 'text': 'This is how you delete an image.', 'start': 967.327, 'duration': 1.921}, {'end': 979.661, 'text': "But but I can delete it because it's as it says, the docker is used by a stopped container.", 'start': 972.349, 'duration': 7.312}, {'end': 982.946, 'text': 'So if I do docker PS minus eight.', 'start': 979.961, 'duration': 2.985}, {'end': 989.227, 'text': "Actually, let's grab to my app like this.", 'start': 984.443, 'duration': 4.784}, {'end': 993.311, 'text': 'I have to first delete the container.', 'start': 990.909, 'duration': 2.402}, {'end': 995.392, 'text': 'So this is how you delete a container.', 'start': 993.611, 'duration': 1.781}, {'end': 996.854, 'text': "It's Docker are in.", 'start': 995.472, 'duration': 1.382}], 'summary': 'Troubleshooting docker: resolving server jazz file issue and managing docker images and containers.', 'duration': 77.477, 'max_score': 919.377, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs919377.jpg'}, {'end': 1067.813, 'src': 'embed', 'start': 1036.288, 'weight': 6, 'content': [{'end': 1041.512, 'text': 'And as you see, the problem is fixed at listening on Port 3000.', 'start': 1036.288, 'duration': 5.224}, {'end': 1042.712, 'text': 'So our app is running.', 'start': 1041.512, 'duration': 1.2}, {'end': 1046.335, 'text': 'So this one here, my app one point zero.', 'start': 1043.413, 'duration': 2.922}, {'end': 1051.158, 'text': 'First of all, we can see the logs here like this.', 'start': 1046.714, 'duration': 4.444}, {'end': 1055.06, 'text': 'We see that the app is listening on Port 3000.', 'start': 1051.758, 'duration': 3.302}, {'end': 1055.901, 'text': 'We know everything is cool.', 'start': 1055.06, 'duration': 0.841}, {'end': 1058.649, 'text': 'to actually just get a little bit more inside.', 'start': 1056.328, 'duration': 2.321}, {'end': 1067.813, 'text': "Let's enter the containers or let's get the terminal, the command line terminal of the container and look around there.", 'start': 1059.029, 'duration': 8.784}], 'summary': "App is fixed at listening on port 3000, running version 1.0, and logs confirm it's working.", 'duration': 31.525, 'max_score': 1036.288, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs1036288.jpg'}], 'start': 823.141, 'title': 'Jenkins, docker, and image building', 'summary': 'Covers building docker images with jenkins, sharing them in a repository, modifying docker files, and rebuilding images, resulting in successful app deployment and testing within a team setting.', 'chapters': [{'end': 918.176, 'start': 823.141, 'title': 'Jenkins and docker workflow', 'summary': 'Discusses the process of building a docker image using jenkins, sharing it in a docker repository, and using the image for testing and deployment within a team setting.', 'duration': 95.035, 'highlights': ['Jenkins builds a Docker image based on the Docker file, facilitating collaborative development within a team setting.', 'Sharing the Docker image in a repository enables team members to access and test the application locally or deploy it on a development server.', 'The process involves committing the Docker file with the code, Jenkins building the image, and sharing it in a Docker repository for testing and deployment purposes.']}, {'end': 1058.649, 'start': 919.377, 'title': 'Docker file modification and image rebuilding', 'summary': 'Demonstrates modifying a docker file, deleting an image and container, rebuilding the image, and resolving an issue, resulting in the app running successfully on port 3000.', 'duration': 139.272, 'highlights': ['The issue of not finding the server jazz file is addressed by modifying the Docker file to include the correct directory, resulting in the successful running of the app on Port 3000.', 'The process of deleting a container before deleting an image is explained, highlighting the necessary steps to delete an image successfully in Docker.', 'The necessity of rebuilding an image when modifying a Docker file is emphasized, indicating that the old image cannot be overwritten and needs to be deleted before rebuilding.', 'The successful rebuilding of the modified Docker file is demonstrated, resulting in the app running successfully on Port 3000.', 'The process of checking the logs to confirm the app is listening on Port 3000 is highlighted as a way to verify the successful running of the app.']}], 'duration': 235.508, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs823141.jpg', 'highlights': ['Jenkins builds a Docker image based on the Docker file, facilitating collaborative development within a team setting.', 'Sharing the Docker image in a repository enables team members to access and test the application locally or deploy it on a development server.', 'The process involves committing the Docker file with the code, Jenkins building the image, and sharing it in a Docker repository for testing and deployment purposes.', 'The issue of not finding the server jazz file is addressed by modifying the Docker file to include the correct directory, resulting in the successful running of the app on Port 3000.', 'The process of deleting a container before deleting an image is explained, highlighting the necessary steps to delete an image successfully in Docker.', 'The necessity of rebuilding an image when modifying a Docker file is emphasized, indicating that the old image cannot be overwritten and needs to be deleted before rebuilding.', 'The successful rebuilding of the modified Docker file is demonstrated, resulting in the app running successfully on Port 3000.', 'The process of checking the logs to confirm the app is listening on Port 3000 is highlighted as a way to verify the successful running of the app.']}, {'end': 1443.942, 'segs': [{'end': 1123.158, 'src': 'embed', 'start': 1059.029, 'weight': 0, 'content': [{'end': 1067.813, 'text': "Let's enter the containers or let's get the terminal, the command line terminal of the container and look around there.", 'start': 1059.029, 'duration': 8.784}, {'end': 1072.795, 'text': "So I'm going to say docker exec interactive terminal.", 'start': 1068.753, 'duration': 4.042}, {'end': 1078.838, 'text': "I'm going to specify the container ID like this.", 'start': 1073.436, 'duration': 5.402}, {'end': 1085.376, 'text': "And since being best doesn't work, we can actually try shell.", 'start': 1080.751, 'duration': 4.625}, {'end': 1094.365, 'text': 'So this is something you will also encounter because some containers do not have bash installed.', 'start': 1085.876, 'duration': 8.489}, {'end': 1098.068, 'text': 'So we have to connect using been S.H.', 'start': 1094.565, 'duration': 3.503}, {'end': 1102.461, 'text': 'So one of them has to work always.', 'start': 1100.359, 'duration': 2.102}, {'end': 1105.723, 'text': "So let's see in which directory we are.", 'start': 1103.321, 'duration': 2.402}, {'end': 1110.467, 'text': 'So we are in the root directory and we see our virtual file system there.', 'start': 1105.904, 'duration': 4.563}, {'end': 1113.19, 'text': 'And as you see, the cursor changed as well.', 'start': 1110.908, 'duration': 2.282}, {'end': 1115.732, 'text': "So that means we're inside of a container.", 'start': 1113.37, 'duration': 2.362}, {'end': 1119.134, 'text': "So now let's actually check some of this stuff.", 'start': 1116.592, 'duration': 2.542}, {'end': 1123.158, 'text': 'So first of all, we specified some environmental variables here.', 'start': 1119.835, 'duration': 3.323}], 'summary': "Using docker exec, explored container's terminal, accessed root directory, and checked environmental variables.", 'duration': 64.129, 'max_score': 1059.029, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs1059029.jpg'}, {'end': 1235.753, 'src': 'embed', 'start': 1204.87, 'weight': 2, 'content': [{'end': 1208.891, 'text': "So what I'm going to do is I'm going to create an app directory.", 'start': 1204.87, 'duration': 4.021}, {'end': 1218.696, 'text': "And I'm going to copy just the files that I'm going to need for starting an application inside of a container.", 'start': 1210.47, 'duration': 8.226}, {'end': 1221.057, 'text': "So I'm going to take those.", 'start': 1218.716, 'duration': 2.341}, {'end': 1224.54, 'text': 'And the images as well.', 'start': 1223.159, 'duration': 1.381}, {'end': 1227.807, 'text': 'So all these are just external ones.', 'start': 1225.785, 'duration': 2.022}, {'end': 1228.687, 'text': "We don't need them there.", 'start': 1227.827, 'duration': 0.86}, {'end': 1235.753, 'text': 'And images, the index HTML file packages and services and node modules are inside of it.', 'start': 1229.228, 'duration': 6.525}], 'summary': 'Creating an app directory and copying necessary files for starting an application inside a container.', 'duration': 30.883, 'max_score': 1204.87, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs1204870.jpg'}, {'end': 1407.847, 'src': 'embed', 'start': 1372.372, 'weight': 3, 'content': [{'end': 1376.415, 'text': 'OK, but, as I said, this was just for demonstration purposes,', 'start': 1372.372, 'duration': 4.043}, {'end': 1382.358, 'text': 'because I just wanted to show you how you can actually start it as a container and how it should look inside.', 'start': 1376.415, 'duration': 5.943}, {'end': 1388.142, 'text': 'And in this case, we improved a couple of things, but usually we would start this container from a Docker compose as well.', 'start': 1382.438, 'duration': 5.704}, {'end': 1392.503, 'text': 'together with all the other images that the application uses.', 'start': 1388.702, 'duration': 3.801}, {'end': 1394.964, 'text': "And it also doesn't have any ports open.", 'start': 1393.163, 'duration': 1.801}, {'end': 1397.984, 'text': 'So this is just for demonstration purposes.', 'start': 1395.364, 'duration': 2.62}, {'end': 1407.847, 'text': 'So in the next video, we actually going to see how to create a private repository and how to push images into that private repository.', 'start': 1398.485, 'duration': 9.362}], 'summary': 'Demonstrated starting container, improved a few things, will use docker compose for other images, no open ports, next video: creating private repository and pushing images', 'duration': 35.475, 'max_score': 1372.372, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs1372372.jpg'}], 'start': 1059.029, 'title': 'Docker container interaction and file configuration', 'summary': "Provides a guide on interacting with docker containers, including accessing the command line terminal, navigating the container's file system, and checking environmental variables. it also outlines the process of optimizing a docker file by creating an app directory, copying necessary files, and removing unnecessary ones, resulting in a more efficient container setup and demonstrating the process of entering, running, and exiting the container.", 'chapters': [{'end': 1144.964, 'start': 1059.029, 'title': 'Interacting with docker containers', 'summary': "Provides a guide on interacting with docker containers, including accessing the command line terminal, navigating the container's file system, and checking environmental variables set in the docker environment.", 'duration': 85.935, 'highlights': ["Accessing the command line terminal of a Docker container is demonstrated using the 'docker exec interactive terminal' command, with consideration for the use of 'shell' when 'bash' is not installed.", "Navigating the container's file system and checking environmental variables set in the Docker environment, including the MongoDB username and password, are showcased as essential actions within the container."]}, {'end': 1443.942, 'start': 1145.845, 'title': 'Docker file configuration', 'summary': 'Outlines the process of optimizing a docker file by creating an app directory, copying necessary files, and removing unnecessary ones, resulting in a more efficient container setup and demonstrating the process of entering, running, and exiting the container.', 'duration': 298.097, 'highlights': ['The process of optimizing a Docker file by creating an app directory, copying necessary files, and removing unnecessary ones resulted in a more efficient container setup. The speaker demonstrates creating an app directory, copying only necessary files, and removing unnecessary ones, resulting in a more efficient container setup.', 'Demonstrating the process of entering, running, and exiting the container. The speaker demonstrates the steps of entering, running, and exiting the container, showcasing the functionality of the optimized Docker file setup.']}], 'duration': 384.913, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/WmcdMiyqfZs/pics/WmcdMiyqfZs1059029.jpg', 'highlights': ["Accessing the command line terminal of a Docker container using 'docker exec interactive terminal' command", "Navigating the container's file system and checking environmental variables set in the Docker environment", 'Optimizing a Docker file by creating an app directory, copying necessary files, and removing unnecessary ones', 'Demonstrating the process of entering, running, and exiting the container']}], 'highlights': ['Jenkins packages the JavaScript application using NPM build into a Docker image and then pushes it into a Docker repository.', 'The process involves packaging a JavaScript application into a Docker container for deployment.', 'The use of a MongoDB Docker container is part of the deployment process for the JavaScript application.', 'Testing the application feature is necessary before deploying it, ensuring readiness for deployment.', 'The process involves creating a Dockerfile as a blueprint, basing the image on a ready node image, and configuring environmental variables within the Dockerfile.', 'The Dockerfile provides an alternative method to define environmental variables, allowing for external definition in a Docker compose file, avoiding the need for image rebuilding upon changes.', 'Jenkins builds a Docker image based on the Docker file, facilitating collaborative development within a team setting.', 'Sharing the Docker image in a repository enables team members to access and test the application locally or deploy it on a development server.', 'The process involves committing the Docker file with the code, Jenkins building the image, and sharing it in a Docker repository for testing and deployment purposes.', 'The issue of not finding the server jazz file is addressed by modifying the Docker file to include the correct directory, resulting in the successful running of the app on Port 3000.', 'The process of deleting a container before deleting an image is explained, highlighting the necessary steps to delete an image successfully in Docker.', 'The necessity of rebuilding an image when modifying a Docker file is emphasized, indicating that the old image cannot be overwritten and needs to be deleted before rebuilding.', 'The successful rebuilding of the modified Docker file is demonstrated, resulting in the app running successfully on Port 3000.', "Accessing the command line terminal of a Docker container using 'docker exec interactive terminal' command", "Navigating the container's file system and checking environmental variables set in the Docker environment", 'Optimizing a Docker file by creating an app directory, copying necessary files, and removing unnecessary ones', 'Demonstrating the process of entering, running, and exiting the container']}