[Intro Music]
Alright, let's move on. And in the
next few lectures we will explore
elasticsearch image. But what is
Elasticsearch? Elasticsearch is a
search engine that allows you
pretty efficient and fast search
documents and indexes. And it is
very, very often used for real time
searches, for searches of some
data and so on. And now, let's plan
what we will do in the few next
lectures. First, we will download
the elasticsearch image, and
second, we will need to have some
container from which we will
perform commands on Elasticsearch
server, and for that we will use
'curl' utility. And now let me try to
find whether we are able to use
this 'curl' utility inside busybox
or alpine or ubuntu containers. And
let me try to do that now. So let
me go to terminal, and let me create
first busybox container, 'docker
run -it busybox'. And here,
let me type 'curl'; and I see error
'curl: not found'. And that means that
this utility that allows you to
perform PUT, GET request is not
shipped with busybox container by
default. Let me try to find out
whether it is available in alpine
container, 'docker run -it alpine',
let me type 'curl' here, and
again I see error, 'curl: not
found'. Let me exit from here. And
let me try to run ubuntu image,
'docker run -it ubuntu', and
here type 'curl', and again 'command
not found'. That means that this
command is not shipped either with
ubuntu or busybox, or alpine
containers out of the box. And
there are actually two solutions
for such problems when there is no
command that you need to use.
First one, you could install
additional package, for example, in
this container, ubuntu container;
and from the package use 'curl'
command. Same you're able to do for
busybox and alpine container. But
there is also another way. And we
could try to search for 'curl' image
at Docker Hub, probably some other
people have already created a
small tiny container that is based
either on busybox or alpine, and has
already this 'curl' utility out of
the box. Let me try to find out
that. Let me exit from this
container, and let me go to Docker
Hub, and here let me type 'curl',
press Enter, and let's check out
those results. Basically, there are
no official images called 'curl'.
And you see that in all those
results there is a prefix, and
that means that those images were
created by some users in Docker
Hub. Okay, let me check this first
result 'curlimages/curl'. How
much downloads it has, 10
million. Let me check quantity of
stars, 16. Probably let me check
this one. I see that it is Alpine-
based image with just curl.
Basically, our goal is to find
really small, tiny image at
Docker hub that will be based on
Alpine for example, and that will
have additionally 'curl' utility already
installed inside of it. Let me
verify this one, 'appropriate/curl',
this one. Yeah, and it has
much more pulls, more than 100
million. Let's probably use this
one. Let me scroll down. And here
we are able to pull it like so. Let
me copy this command, and let's go
to terminal and pull it over, 'docker
pull appropriate/curl'. I'm sure
that it will be really small in
size. Let's verify its size, 'docker
images', and its size is around five
megabytes. Here it is. All right.
Let me now try to create a new
container based on this image. Let
me copy its name, clear terminal,
'docker run -it', and name of the
image. And it seems that
default command is not sh or bash
here in this image. Let me verify
basically what is the default
command here. 'docker history'
command will help us here, and paste
here name of the image, and you see
that default command is actually 'curl',
and we are actually able to
run this image by supplying a
specific URL we want to pass as
argument to 'curl' command. Let me
show you that. 'docker run -it
appropriate/curl'; and here we could
type for example 'google.com';
and here is response from server,
301 Moved, moved
permanently. And actually, I am not
happy with such way of execution of
'curl' commands because we will need
to execute multiple commands in
order to interact with Elasticsearch
server. This way let me try
to override the default command, that is
'curl' for this image; and let me
try to enter 'sh' command instead.
Let me clear terminal, and here go
to this command and add 'sh', that
will override again, default
command 'curl'. All right, I'm now
in 'sh', let me type 'curl --
help'. And yes, now this command is
available here in this image, and
here is help that you are able to
use in order to understand how to
use 'curl'. There are really much
much of different options, but we
will not use all of them.
Basically, let me just try to enter
a 'curl google.com' here; and I get
the same result. If I basically
enter 'curl www.
google.com', I should get another
page and yes, I get the complete
HTML page. Great. That's how we are
able to use the 'curl' command
inside of this container. And I'm
completely happy with that. We don't
need to install 'curl' separately
either in alpine container or
ubuntu container. Wonderful. Now,
we are ready to proceed, and
next we will create elasticsearch
container, and another such kind
container, and we will communicate
with Elasticsearch server from this
container that will be based on
'appropriate/curl' image. And next
comes actually challenge for you.
You will need to perform this
initial setup yourself. I'll see you next.
[no audio]