
Join the Conversation!
Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.
"Please login to view comments"
Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.
By logging in, you'll unlock full access to this and other free tutorials on JSM Pro.
Why? Logging in lets us personalize your learning experience, track your progress, and keep you in the loop with new workshops, coding tips, and platform updates.
You'll also be the first to know about upcoming launches, events, and exclusive discounts.
No spam—just helpful content to level up your skills.
If that sounds fair, go ahead and log in to continue →
Enter your name and email to get instant access
##Looks like we found a thief monkey By the way, I liked the trick how you reached till here. You have a good sense of humor. You will improve a lot if you join our course with this passion.
var
(function-scoped, outdated)let
(block-scoped, modern and recommended)const
(block-scoped, cannot be reassigned)_
, or $
let let = 5;
is invalid)myVar
and myvar
are different)string
, number
, boolean
, null
, undefined
, bigint
, symbol
Objects
, Arrays
, Functions
Subscribing gives you access to a brief, insightful summary of each lecture to stay on track.
00:00:00 Using Docker is super simple.
00:00:03 All you have to do is click the link in the description, download Docker Desktop for your own operating system, and that will help you containerize your
00:00:13 application in the easiest way possible.
00:00:17 It'll definitely take some time to download, but once you're there, you can accept the recommended settings and sign up.
00:00:24 Once you're in, on the left side, you can see the links to containers, which display the containers we've made, images, which shows the images we've built,
00:00:35 and volumes, which shows the shared volumes we have created for our containers, and other beta features like builds, dev environments,
00:00:45 and Docker scout.
00:00:47 Now, return to the browser and Google Docker Hub.
00:00:51 The first result will surely be hub.docker.com.
00:00:56 Then, open it up, go to Explore, and you can see all of the public images created so far by developers worldwide.
00:01:05 from official images by verified publishers to sponsored open source ones covering everything from operating system images like Ubuntu,
00:01:14 languages like Python and Golang, databases like Redis, Postgres, Mongo for MongoDB, MySQL, runtimes like Node.js, to even Hello World Docker image,
00:01:26 and also the old peeps like WordPress and PHP.
00:01:31 Almost everything that you need is right here.
00:01:34 But how do we create our own Docker images?
00:01:38 Easy peasy.
00:01:39 Creating a Docker image starts from a special file called Dockerfile.
00:01:44 It's a set of instructions telling Docker how to build an image for your application.
00:01:50 There are some specific instructions and keywords we use to tell Docker what we want through the Dockerfile.
00:01:57 Think of it as Docker syntax or language to specify exactly what we want.
00:02:03 Here are some of the commands.
00:02:05 From specifies the base image to use for the new image.
00:02:10 It's like picking a starting kitchen that already has some basic tools and ingredients.
00:02:15 WorkDir sets the working directory for the following instructions.
00:02:19 It's like deciding where in the kitchen you want to do all your cooking.
00:02:24 Copy copies the files or directories from the build context to the image.
00:02:29 It's like bringing in your recipe, ingredients, and any special tools into your chosen cooking spot.
00:02:35 Run executes commands in the shell during image build.
00:02:40 It's like doing specific steps of your recipe, such as mixing ingredients.
00:02:45 Expose informs Docker that the container will listen on specified network ports at runtime.
00:02:52 It's like saying, I'm going to use this specific part of the kitchen to serve the food.
00:02:57 ENV sets environment variables during the build process.
00:03:01 You can think of that as setting the kitchen environment, such as deciding whether it's a busy restaurant or a quiet home kitchen.
00:03:08 ARG defines build time variables.
00:03:12 It's like having a note that you can change before you start cooking, like deciding if you want to use fresh or frozen ingredients.
00:03:20 Volume creates a mount point for externally mounted volumes, essentially specifying a location inside your container where you can connect external storage.
00:03:31 It's like leaving a designated space in your kitchen for someone to bring in extra supplies if needed.
00:03:37 CMD provides default command to execute when the container starts.
00:03:42 It's like specifying what dish you want to make when someone orders from your menu.
00:03:47 EntryPoint specifies the default executable to be run when the container starts.
00:03:52 It's like having a default dish on your menu that people will get unless they specifically ask for something else.
00:03:59 And you might wonder, isn't EntryPoint the same as CMD?
00:04:04 Well, not really.
00:04:06 In simple terms, both CMD and EntryPoint are instructions in Docker for defining the default command to run when a container starts.
00:04:17 The key difference is that CMD is more flexible and can be overridden when running the container, while entry point defines the main command that cannot
00:04:27 be easily overridden.
00:04:29 Think of CMD as providing a default, which can be changed, and entry point as setting a fixed starting point for your container.
00:04:37 If both are used, CMD arguments will be passed to entry point.
00:04:42 And these are the most used keywords when creating a Docker file.
00:04:47 I have also prepared a list of other options you can use in Docker files.
00:04:51 You can think of it as a complete guide and a cheat sheet you can refer to when using Docker.
00:04:57 The link is in the description.
00:04:58 But now, let's actually use some of these commands in practice.
00:05:03 Let's try to run one of the images listed in the Docker Hub to see how that works.
00:05:08 Let's choose one of the operating system images as an example.
00:05:12 Let's go for Ubuntu.
00:05:14 On the right side of the details of the image, you'll see a command.
00:05:17 Copy it and try executing it in your terminal.
00:05:21 But before we paste it, first create a new empty folder on our desktop called Docker underscore course.
00:05:28 and then drag and drop it to our empty Visual Studio Code window.
00:05:33 Open up your empty terminal and paste the command docker pull ubuntu.
00:05:38 It's going to do it using the default tag latest and it's going to take some time to pull it.
00:05:44 As you can see, it's working.
00:05:46 Docker initially checks if there are any images with that name on our machine.
00:05:51 If not, it searches for the Docker Hub, finds the image, and automatically installs it on our machine.
00:05:58 Now, if we go back to Docker Desktop, we'll immediately see an Ubuntu image right here under Images.
00:06:05 To confirm that we actually installed a whole different operating system, we can run a command that executes the image.
00:06:13 Do you know how that process is called?
00:06:15 Creating a container.
00:06:17 So let's run docker run-it for interactive and then ubuntu and press enter.
00:06:27 After you run this command, head over to docker desktop.
00:06:30 And if you go to containers, you'll see a new container based off of the ubuntu image.
00:06:36 Coming back to our terminal, you'll see something different.
00:06:39 If you've ever tried Ubuntu before, you'll notice that this terminal looks exactly like the Ubuntu command line.
00:06:46 Let's test out some of the commands.
00:06:49 ls for list.
00:06:51 We have cd home to move to our home directory.
00:06:55 mkdir, which is going to create a new directory called hello.
00:06:59 We can once again ls.
00:07:01 cd into hello to navigate to it.
00:07:04 We can create a new hello-ubuntu.txt.
00:07:10 We can LS to check it out if it's there.
00:07:13 And it is.
00:07:14 We have just used different Ubuntu commands right here within our terminal.
00:07:19 Amazing, isn't it?
00:07:21 We are running an entirely different operating system simply by executing a Docker image within a Docker container.
00:07:29 For now, let's kill this terminal by pressing this trash icon and navigate back to our Docker desktop.
00:07:36 Now, a bigger question awaits.
00:07:38 How do we create our own Docker images?