Docker Compose vs Dockerfile - Dockerfile Explained - Docker Tutorial
HTML-код
- Опубликовано: 15 июл 2024
- This video is a docker tutorial which explains the two main components of Docker - Docker Compose & Dockerfile (docker compose vs dockerfile).
This video is part of a series and this series helps you to learn docker from scratch. This series is a docker tutorial for beginners.
What is a Docker File?
Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
In the video we are showing a dockerfile example from which you can learn how to create dockerfile / how to write dockerfile. Dockerfile step by step procedure to create Docker Images from it.
Commonly Used Dockerfile Commands (Dockerfile Instructions):
1. FROM
2. RUN
3. CMD
4. ENTRYPOINT
5. WORKDIR
6. COPY
7. ADD
8. EXPOSE
9. LABEL
10. VOLUME
11. USER
12. ENV
13. ARG
14. ONBUILD
What is docker compose and what is docker compose used for?
Docker Compose is a tool to help define and share multi-container applications (introduction to docker compose).
It’s an important tool for any application that needs multiple microservices, as it allows each service to easily be in a separately managed container.
How to use Docker Compose?
We can use a YAML file to configure your application’s services.
The configuration for a docker compose file is done in docker-compose.yml.
You don’t need to place this at the root of your project like a Dockerfile. In fact, it can go anywhere, as it doesn’t depend on any other code. However, if you’re building the images locally, it will need to go in a project folder with the code being built.
In the video you can see how to use docker compose yml file and how to run docker compose file.
Video Chapters:
0:00 - Dockerfile Basics
0:57 - Dockerfile Explained
3:33 - Dockerfile Commands
6:08 - Dockerfile Build Container
10:20 - Introduction to Docker Compose
11:19 - Docker Compose UP
#CodingDroplets #Docker
⭐ Join Us on Patreon: www.patreon.com/CodingDroplets
Microservices Tutorial Playlist Link: ruclips.net/video/gPInkLCfalE/видео.html
Thank you. The Docker-Compose explanation was spot on.
You are most welcome
A perfect video for a beginner trying to learn the basics. Thanks a lot.
You are welcome! Glad to know you liked it.
Your explanation was so clear and understandable.
Thanks for the tutorial,
Excellent !
Thank you so much for your positive feedback! I'm delighted to hear that you found the explanation clear and understandable.
I was randomly scrolling couple of videos to get a refresher before my interview and I would say this is one of the best and easiest explanation of Docker. Thanks for saving my time.
Great to hear! Your words mean a lot to me
the background and the overall explorer theme on 08:30 is of great esthetics, good move!
Thank You!
Extremely helpful thank you.
Welcome
A Small Token of Appreciation.. 💯 Very nice.. and Excellent Coverage with Good Presentaion and explanation in less time. 👋
So nice of you. Thank you so much for the support ❤
Thank you very much
You are welcome
💯 Very nice.. and Excellent Coverage with Good Presentaion and explanation in less time. 👋
Glad to know you liked it!
Excellent explanation
Thank you for your comment and feedback! Glad to hear that.
Thank you
You're welcome
thanks
You're welcome!
very nice explained
I'm glad to hear that you found the video helpful and that the explanation was clear. Docker can be a complex topic to understand, so it's always great to receive feedback like this, knowing that my efforts to make the tutorial easy to follow are paying off. Thank you for your support!
@@CodingDroplets keep going. it is awsome tutorial
Thank you for your kind words of support!
Thank you so much for the video, it was very helpful! I was wondering what screen recorder you use because it looks so crisp.
Thank you for your kind words! I'm glad you found the tutorial helpful. I appreciate your compliment on the video quality.
For screen recording, I use OBS Studio (Open Broadcaster Software). It's a free and open-source software that allows me to capture my screen and create high-quality videos. I find it to be a versatile tool for recording tutorials and demonstrations.
Thank you again for your feedback, and I'm glad you enjoyed the video!
@@CodingDroplets Thank you very much for the information!
My Raspberry Pi Lite OS runs on a 64GB Micro SD card boot drive and I have a secondary 2TB SSD to store data in. I plan to install Jellyfin and PhotoPrism and NextCloud which requires installing Maria MySQL Data Base. What has me confused is how I specify all docker data storage for PhotoPrism, JellyFin and Nextcloud to take place on the 2TB SSD drive and not the 64GB Micro SD card boot drive? Do you have a video that shows correct docker Volume syntax that enables data to get stored onto a 2TB SSD secondary data drive?
Have you got the answer?
How can one determine what should be included in the docker compose file? For example if I want to make a Django website, how do I know what services to include in the file and what keywords to use?
Creating a Docker Compose file for a Django website involves specifying the necessary services, configurations, and dependencies for your application. Determine the main components of your Django application, such as the web server, database, and any additional services. In your Docker Compose file (docker-compose.yml), define each service as a separate block.
If someone don't use user name and password in sql server means use window authentication then what should i write in environment in docker compose ??
Normally I use Linux operating system for sql server container in docker. Why you need windows authentication?
2:27
I'm not quite sure what you're asking. Could you please clarify?
I wanted to do a connection between mongodb container and hadoop container ... can u help me plz !?
You can place both the containers under the same docker network. So that they can connect each other.
We'll be covering more about Docker Networking in our upcoming videos.
I did it but i got errors ...i need help plz
Can you please explain about the error you are getting?
Thanks for this 💯!
When I ran the command : docker-compose up
I got this error : The system cannot find the file specified: 'C:\\Users\\compose_spec.json'>
[21308] Failed to execute script docker-compose
Any help ?
Have you installed docker in your machine? Hope you are using windows operating system.
@@CodingDroplets Thanks for quick reply
Yeah, I ve installed Docker Desktop and Yes it is Windows 10
You are welcome! Normally docker compose will get installed along with docker desktop in windows. Please have a look on the below URL.
docs.docker.com/desktop/windows/install/
@@CodingDroplets Actually, I ve installed by following instructions on it
@@CodingDroplets Fun fact, I ve tried to launch the command without launching Docker Desktop but got the same error while I was expecting a different one based on Docker Desktop Services ain't launched !
😥 Whyyyy?
Nice! Would have been even better if you showed how to re-deploy updates or clean stuff up when you no longer need them. Still very informative. Thanx!!!
Thank You for your valuable feedback.
This video is part of a series named Microservice Architecture.
ruclips.net/p/PLzewa6pjbr3JQKhB_U_FiuYwQC70i-TyU
We have already explained how to remove containers, images etc in other videos. Will be uploading videos about more advanced things soon.
Hello, it is a great tutorial butwhen running command :"docker build -t sample-img ." I got stuck on the following issue :
PS C:\Users\jacek\source
epos\DockerFileSample> docker build -t sample-img .
[+] Building 0.2s (2/2) FINISHED docker:default
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 2B 0.0s
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3142463899/Dockerfile: no such file or directory
I'm sorry to hear you're facing an issue. It looks like there might be a problem with the path or context when running the docker build command.
Ensure that you are running the command from the correct directory where your Dockerfile is located. If your Dockerfile is in a different directory, you can specify the path explicitly.
docker build -t sample-img path/to/your/Dockerfile-directory
it was my stupid mistake. I have added .txt extension :)@@CodingDroplets