1
00:00:00,420 --> 00:00:08,220
So now let's actually go ahead and check out the other application, which is a job, I also have a

2
00:00:08,220 --> 00:00:10,920
repository for that so you can clone it from there.

3
00:00:13,640 --> 00:00:17,240
Again, let's copy the good command and.

4
00:00:21,050 --> 00:00:23,390
I'm going to it right here.

5
00:00:27,250 --> 00:00:30,000
Now, let's open it in intelligence as well.

6
00:00:32,940 --> 00:00:34,770
Sure, no window.

7
00:00:36,240 --> 00:00:42,750
So this is a gradle project, so it's going to install the dependencies and all the necessary stuff

8
00:00:43,860 --> 00:00:45,280
when I open the project.

9
00:00:45,750 --> 00:00:49,720
This is also a very simple set up of Java application.

10
00:00:50,130 --> 00:00:52,110
We have one Java file.

11
00:00:53,260 --> 00:00:58,820
Which is important, Java, and this is all that the application does.

12
00:00:59,080 --> 00:01:06,460
So basically we initialize a springboard application right here and the only thing we have is a logger

13
00:01:06,490 --> 00:01:09,910
that basically just logs some stuff on Infl level.

14
00:01:10,210 --> 00:01:16,840
And we also throw an exception so that we have an exception log in our logging system.

15
00:01:17,350 --> 00:01:22,360
Same as, you know, just we just log a couple of lines and that's it.

16
00:01:23,310 --> 00:01:28,360
Important thing here as well is that we are logging in JSON format.

17
00:01:29,890 --> 00:01:37,300
So this logger here is configured to log in, Jason, and let's go and see where this is configured.

18
00:01:37,690 --> 00:01:45,310
So first of all, this is our field gradle file, which is equivalent of ponded XML in even we have

19
00:01:45,310 --> 00:01:52,500
the dependencies list here and the repositories where to pull those dependencies from and the plug ins.

20
00:01:53,110 --> 00:02:00,490
So we have the springboard dependency and the second dependency is the log stash log back encoder.

21
00:02:00,670 --> 00:02:05,050
That's the one that actually is configured to log in, Jason.

22
00:02:05,440 --> 00:02:09,900
And that configuration file is right here in resources.

23
00:02:10,030 --> 00:02:18,520
I have created this lookback or XML file, which basically configures this logging encoder for Jason

24
00:02:18,520 --> 00:02:22,220
and then some other stuff configured like which level and so on.

25
00:02:22,600 --> 00:02:28,390
So this will produce the logs and here you have the field names that this log entry will contain.

26
00:02:28,630 --> 00:02:36,460
So we have the timestamp and just like we did in Node EBP, where we configured the timestamp format

27
00:02:36,460 --> 00:02:41,680
and set the time field name here, we're actually going to use the same name here.

28
00:02:41,710 --> 00:02:48,640
Let's actually change this t is two times so they both have the same field name for the same data.

29
00:02:48,640 --> 00:02:49,000
So source.

30
00:02:50,660 --> 00:02:56,870
This will be easier to pass later as well, and we also have a properties file where we get the values

31
00:02:57,290 --> 00:03:00,750
for this configuration from and this is right here.

32
00:03:00,800 --> 00:03:06,110
This is a spring application properties file where I just have to find some key value pairs.

33
00:03:06,290 --> 00:03:13,670
We have the application name banner mode of basically means that we don't want to see the spring application

34
00:03:13,670 --> 00:03:17,390
banner because that's not Jason Friendly or that's not Jason formate.

35
00:03:17,400 --> 00:03:22,060
So we're just going to turn that off to clean our logs.

36
00:03:22,760 --> 00:03:30,860
We have the info level for everything other than spring framework looks, so that should work fun and

37
00:03:30,860 --> 00:03:31,380
that's it.

38
00:03:31,430 --> 00:03:35,480
That's the whole Java Springboards basic application configuration.

39
00:03:36,020 --> 00:03:39,590
And again, we want to build this into a Docker image.

40
00:03:39,650 --> 00:03:41,540
That's why we have Docker file here.

41
00:03:41,690 --> 00:03:46,490
We also have a base image for Java, which is open JDK eight.

42
00:03:46,670 --> 00:03:54,440
This is the base image on which our Java application image will, based on Expo's, basically means

43
00:03:54,440 --> 00:03:59,260
that our application will start at Port Hédi inside the container.

44
00:03:59,930 --> 00:04:10,160
And here we also copy the application files or the application zha into a folder inside container so

45
00:04:10,160 --> 00:04:11,090
that we can run.

46
00:04:11,090 --> 00:04:13,970
It encourages application.

47
00:04:14,570 --> 00:04:21,920
We just copied the server Jaspal in the package and here we are first going to build Java application

48
00:04:21,920 --> 00:04:29,530
into a jar file and then we're going to copy that into that destination folder inside the container.

49
00:04:29,720 --> 00:04:39,080
And again, we're setting this folder as a route inside container so that we can reference the Java

50
00:04:39,080 --> 00:04:42,320
file without full path like this.

51
00:04:42,800 --> 00:04:44,170
So we don't need that anymore.

52
00:04:44,210 --> 00:04:48,310
We can just say the name of the jar.

53
00:04:48,380 --> 00:04:48,790
Right.

54
00:04:48,800 --> 00:04:53,450
And this is, again, just like we would run it locally.

55
00:04:53,450 --> 00:04:57,160
It's Java, Java and the Java.

56
00:04:57,500 --> 00:05:02,750
No, we don't have the Java yet in the built folder because we don't have a built folder.

57
00:05:03,020 --> 00:05:07,690
So in order to do that, we first have to build the application.

58
00:05:08,000 --> 00:05:14,670
I also have that guide or those actually three commands in the read me so you can copy that from there.

59
00:05:15,080 --> 00:05:21,160
So the first step to build the image is we build the application itself using gradle repr.

60
00:05:22,190 --> 00:05:28,220
Again, this is equivalent to May one package or install.

61
00:05:29,860 --> 00:05:37,170
And here we have the bill folder, if I go inside, I have this leap's directory and here is my Zha

62
00:05:37,180 --> 00:05:37,970
file, right.

63
00:05:38,570 --> 00:05:46,480
So now I have the jar file that I'm referencing right here so I can build the docker image Docker built

64
00:05:46,480 --> 00:05:55,270
and again, know that I'm in the root folder and my docker files also in the root folder, because this

65
00:05:55,450 --> 00:06:01,220
dot is actually relative to where I'm executing the command from an inside route.

66
00:06:02,560 --> 00:06:05,170
So this is a wrong name here.

67
00:06:05,780 --> 00:06:06,490
Should be Java.

68
00:06:06,700 --> 00:06:07,790
So let's correct that.

69
00:06:11,350 --> 00:06:12,630
So now let's do it again.

70
00:06:14,840 --> 00:06:15,840
And there you go.

71
00:06:15,860 --> 00:06:19,970
All five commands got executed, successfully built our image.

72
00:06:20,150 --> 00:06:21,950
Let's go back and check our images.

73
00:06:23,690 --> 00:06:25,200
Duncker images.

74
00:06:26,450 --> 00:06:28,910
Its grip on EBP.

75
00:06:29,930 --> 00:06:32,320
And here are our both images.

76
00:06:32,840 --> 00:06:35,930
So the next step, we're going to push them to a private repository.
