Intro to Docker [with Java Examples]
Vložit
- čas přidán 2. 06. 2024
- An introduction to @DockerInc covering the most important concepts you need to understand to start using Docker. I'll be using a java application for my examples but the same basic concepts apply for any technology you're using for your applications.
Install Docker: docs.docker.com/get-docker/
Github Repo: github.com/daliasheasha/Hello...
Watch Intro to Docker PART 2 on Networking, Docker Compose: • Intro to Docker - Part...
Docker in IntelliJ IDEA: • Docker in IntelliJ IDEA
Download IntelliJ IDEA: jb.gg/tgrb3m
00:00 - Introduction
00:22 - The Problem (Why Docker?)
03:29 - What is a container?
04:49 - The Solution (Why Docker?)
05:47 - Virtual Machines vs Containers
07:30 - How do I Containerize my Application?
08:44 - [Demo] Create a Hello World Application
09:26 - [Demo] Step 1: Install Docker
10:07 - [Demo] Step 2: Build a Docker Image
16:31 - [Demo] Step 3: Run a Docker Container
Author: Dalia Abo Sheasha ( / daliashea )
Categories:#IntelliJIDEA #Docker #DockerHub - Věda a technologie
I never quite understood Docker until I watched this video. Dalia managed to do the impossible in less than 4 minutes. This is top quality content.
Jet brains should start education channel for such great content
Thank you! Which other types of content would you envision on such a channel?
@@JetBrainsTV project based content would be great
@@JetBrainsTV I would love having a app development video with jetbrain editor
I'm thinking more of replacing existing education system with JetBrains one. They can start with my country's education system anytime, because selling out to Microsoft didn't work so well.
@@JetBrainsTV A project based on Spring Boot, Kafka, Actuators, Spring Data JPA, REST APIs.
even better than docker official tutorial. thank you
Wow, thanks!
Years I avoided Docker, now I'm obsessed, thank you.
I never watch videos in English, but I can listen to Dalia for hours. Please give us more videos with her.
Great edu video. I wish jet brains offer a special edu CZcams channel and courses. Just a suggestion
Positively one of the best introductory tutorials on Docker out there on CZcams.
The quality of the video, the design of the graphics, crystal clear explanation right to the point, and even soft background music make this video outstanding. Thank you
Wow, thanks!
Jesus thank you so much. This is the best video yet about Docker.
Best explanation of Docker Intro concepts I've even seen on web
The bset explanation about docker image creation. Perfect
Nice presentation. I want to add at 5:50 VMs don't suffer only from having to duplicate an OS but also from having to emulate hardware components to the virtual environment. That makes them both heavy and slow.
Loved the way you speak. Crisp, slow and with full attention. Even a kindergarten student will be able to follow! Thanks!
Amazing way to explain Docker. Thanks for sharing it
One of the best videos on Docker... Thanks
Dalia, thank you for a great introductory video! It helped me familiarize with Docker technology. Thumbs up!
The best explanation. Thank you
Very straightforward. Good job!
Amazing video, Dalia!
Thank you so much
There's lots of follow-up stuff to ingest before going productive, of course -- but this _is_ a great introduction for the uninitiated! Kudos!
@Dalia Abo Sheasha I was more thinking along the lines of how to actually create a good image (not with Dockerfile, IMHO); how to configure the Java application through container interfaces; changed assumptions, e.g. short-running small service vs long-running monolith, and consequences; health checks resp. liveness/readiness probes and good practices for them; delegating cross-cutting concerns, e.g. to service mesh; and so on.
In short, there's many things you have to rethink when deploying a container image to, say, a Kubernetes cluster, as opposed to running a WAR in an application server. Just bundling your old application in a Dockerfile is, arguably, not even a good start. :'D
That doesn't take away anything from your video, of course: as I said, it is a good, approachable intro into the "why" of containers, which is often lost in more technical contributions about "how".
Awesome explanation. Thank you.
I am seeing this at the right time, this is so far so good very informative and timing is perfect covers all
Very good video from Java perspective.
Great video and material quality. This kind of format works even better than just a tutorial from Docker. And big thanks for showing us how to use Docker features from IDE.
P.S: and it's easy to consume a material at 2x. Thanks to Dalia for the great pronunciation!
Glad you liked it!
Very very helpful....Thanks a lot ma'am.
This was incredibly helpful! Thank you!
Great content for the beginners who wanted to learn docker
Noble work. Many thanks
Very informative. Thank you so much 🙏🙏
This is useful as currently, we do not have tutorials that clearly explain Java with Docker. Keep it up. However, we would like Tutorials that are more hands-on from your side than you explaining and the code writing itself on the left. None the less thanks so much.
Great presentation. Described the important points using a simple and complete example
Great explanation 👍
Thank you .
Thank you dalia for this great explain! this really was helpful !!
Very nice n helpful video for beginners.
A well-illustrated talk to the point.
Great video and awesome job Dalia!!
Thanks for the visit
Thank you, this video is helpful to start learning docker
Wow! Finally, everything is clear to me :)
Awesome video! Thank you for sharing your knowledge
Good video. For the building step once you made changes, I thought it was good that you built locally to show the updated files, but think it would have been better if you had gone into detail that you could update the docker file to add a build step for you. So you can make sure the code builds from within the container as well not just it builds on my box, which would help illustrate that someone else could build & run the application.
Great video. I thank you.
Thanks a lot. The first sane description of Docker I see.
extreme quality content. Thanks.
That's really awesome explanation , much appreciated , thanks !!!
The best explanation so far! Thank you! :)
Perfect tutorial, thanks !!!
Clear explanation
Super Clean and helpfull 👍
Really like it. Thank you.
Thank You JetBrains for this!
You bet!
Brilliant tutorial! Thanks a lot!
Thank you for clear step by step instruction, save my assignment
Very Nice. Great content.
Thank you, I like your videos. Very nice explanation.
Thanks ! you did amazing job
Very good explanation
Nicely done. Thanks
Brilliant tutorial
This is an excellent intro
excellent video. thank you so much
You are welcome!
Impressive, Dalia!
Thank you! It was very informative
You're welcome!
The best Docker video everrrrr!!!!!!!!!!!!!!!!!!!!! She is just exceptional.
very clear thanks a lot.
A masterpiece !!
this video is perfect in everything
Thank you so much for this video!! Very informative !! Just subscribed and became a customer :). Love JetBrains!
Awesome! Thank you!
بالعربي عظيم جدا ...داليا العظيمة ⚘👑
Thx. I have a better understanding of docker now.
best explanation ever !!!
so cool thank you!
Thank you, i understand docker now.
Great!
Please offer online courses. Your content is sooooo goooood!
just excellent.
I love JetBrains so much 💯💯
The best!!!!🤩
Perfect !!!
I ran into some issues, specially when it comes to running the containers. I believe the following points will help others following this tutorial.
If your Main java class is within a package, make sure that within the DockerFile, you include completely qualified java-package + java-class name.
I had to do...CMD java com.test.docker Main (as my Main class was within the com.test.docker package).
Also, when executing the image, I had to include version numbers. So docker run :
I think I have this issue but your explaination isn't clear to me about where to put extended package information.
How do you create docker container that runs a java swing GUI app? Would Be a great video!
this is nice!
Thank you!
You're welcome!
At 14:54 it doesn't seem to work for me, when I try to build the image. Is there an updated version?
i was looking for tutorial like that to start using docker and java , thanks
and she got Cardi b voice by the way haha
Good!
Great
Excellent video, but at the end you should said that we had to stop de Containers, because they run indefinitely
tellement facile apres avoir vu ca, merci mam'zelle
this video cleared a lot of stuffed air for me, thank you...
trying to run my container after I have built it, I get this [Error: Could not find or load main class EazyBankApplication] I need help on this
Awesome.
Glad you think so!
please, mention there are different wrappers. Spwnt 2 hours useless until found official doc with sprint example
Thanks
Does anyone know how to create a Dockerfile with Maven through IntelliJ?
خیلی خوب بود من رو که خیلی کمک کرد نهار هم دادن تازه واو
Can you do a tutorial on this using Maven
Nice, clear presentation, thanks. Although I think it cruel to put cats and elephants in shipping containers.
Amazing! Thank you so much!
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main 😢
Nice tutorial.You did not explain how to send this my coworkers ?
Hi , facing some issue.Not able to create the image.
C:\Docker-Java\Helloworld>docker version
Client: Docker Engine - Community
Cloud integration: 1.0.12
Version: 20.10.5
API version: 1.41
Go version: go1.13.15
Git commit: 55c4c88
Built: Tue Mar 2 20:14:53 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.5
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 363e9a8
Built: Tue Mar 2 20:15:47 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.4
GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.19.0
GitCommit: de40ad0
C:\Docker-Java\Helloworld>docker build -t helloworld:1.0 .
[+] Building 30.4s (3/3) FINISHED
=> [internal] load build definition from Dockerfile 0.2s
=> => transferring dockerfile: 150B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/openjdk:8 30.0s
------
> [internal] load metadata for docker.io/library/openjdk:8:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head registry-1.docker.io/v2/library/openjdk/ma
nifests/8: dial tcp 54.236.165.68:443: i/o timeout
C:\Docker-Java\Helloworld>
My Docker file :
FROM openjdk:8
RUN mkdir /app
COPY out/production/Helloworld/io/dowlath /app
WORKDIR /app
cmd java dockerjava
Please help on this.
Thanks in advance.
@Dalia Abo Sheasha Sorry could not get. I spelled correctly.
@Dalia Abo Sheasha sure.....thnk q
sorry to disturb you.....i took the code from your repo. but mine java version is jdk 1.8.
So Docker file i changed the version :
# Use the OpenJDK 11 image as the base image
FROM openjdk:8
# Create a new app directory for my application files
RUN mkdir /app
# Copy the app files from host machine to image filesystem
COPY out/production/HelloWorldDocker/ /app
# Set the directory for executing future commands
WORKDIR /app
# Run the Main class
CMD java Main
Still getting the same problem.
Microsoft Windows [Version 10.0.19041.928]
(c) Microsoft Corporation. All rights reserved.
C:\Docker-Java\HelloWorldDocker>docker build -t hello-world:1.0 .
'docker' is not recognized as an internal or external command,
operable program or batch file.
C:\Docker-Java\HelloWorldDocker>docker version
'docker' is not recognized as an internal or external command,
operable program or batch file.
C:\Docker-Java\HelloWorldDocker>docker version
Client:
Cloud integration: 1.0.14
Version: 20.10.6
API version: 1.41
Go version: go1.16.3
Git commit: 370c289
Built: Fri Apr 9 22:49:36 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.6
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8728dd2
Built: Fri Apr 9 22:44:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.4
GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.19.0
GitCommit: de40ad0
C:\Docker-Java\HelloWorldDocker>docker build -t hello-world:1.0 .
[+] Building 5.4s (8/9)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 371B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/openjdk:8 5.1s
=> [auth] library/openjdk:pull token for registry-1.docker.io 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 2B 0.0s
=> CANCELED [1/4] FROM docker.io/library/openjdk:8@sha256:96c15b4ddc92615cc8ab30b60deba963232de521784661e1ab886b64a35a0149 0.1s
=> => resolve docker.io/library/openjdk:8@sha256:96c15b4ddc92615cc8ab30b60deba963232de521784661e1ab886b64a35a0149 0.0s
=> => sha256:96c15b4ddc92615cc8ab30b60deba963232de521784661e1ab886b64a35a0149 1.04kB / 1.04kB 0.0s
=> => sha256:48ff6191b3690194799579907f169ee28929cb4f04b391957232b69b3a139abb 7.83kB / 7.83kB 0.0s
=> => sha256:e35928794b16a9ae525cb294eadb94d1056f7ee4b0b2b204720233cda9d7ca7b 1.79kB / 1.79kB 0.0s
=> CACHED [2/4] RUN mkdir /app 0.0s
=> ERROR [3/4] COPY out/production/HelloWorldDocker/ /app 0.0s
------
> [3/4] COPY out/production/HelloWorldDocker/ /app:
------
failed to compute cache key: failed to walk /var/lib/docker/tmp/buildkit-mount144797670/out/production: lstat /var/lib/docker/tmp/buildkit-mount144797670/o
ut/production: no such file or directory
C:\Docker-Java\HelloWorldDocker>
what about .. Maven .. spring-boot:build-image?