• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    Java
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker for Beginners - Learn Docker in 5 Steps

Docker in 5 Steps

Let's learn Docker in 5 Easy Steps.

Watch the Video Now - https://www.youtube.com/watch?v=Rt5G5Gj7RP0

  • Step 00 - Installing Docker
  • Step 01 - A simple Docker use case - Run an existing application
  • Step 02 - Playing with Docker - Containers and Images
  • Step 03 - How does Docker work?
  • Step 04 - Manually creating a docker image
  • Step 05 - Dockerizing a Spring Boot Application using Dockerfile and Spotify Maven Plugin

Step 00 - Installing Docker

Step 01 - A Simple Docker User Case - Run an existing application

docker run -d -p 5000:5000 in28min/todo-rest-api-h2:1.0.0.RELEASE
docker run -d -p 8761:8761 springcloud/eureka
docker run -d -e MYSQL_ROOT_PASSWORD=dummypassword -e MYSQL_USER=todos-user -e MYSQL_PASSWORD=dummytodos -e MYSQL_DATABASE=todos --p 3306:3306 mysql:5.7

Traditional Deployment

Traditional Deployment

Deployment with Docker

Docker Deployment

Step 02 - Playing with Docker - Containers and Images

  • Image is static
  • Container is dynamic
  649  docker run in28min/todo-rest-api-h2:1.0.0.RELEASE
  650  docker run -p 5000:5000 in28min/todo-rest-api-h2:1.0.0.RELEASE
  651  clear
  652  docker run -p 8761:8761 springcloud/eureka
  653  clear
  654  docker run -d -p 5000:5000 in28min/todo-rest-api-h2:1.0.0.RELEASE
  655  docker run -d -p 8761:8761 springcloud/eureka
  656  docker images
  657  docker containers 
  658  docker containers ls
  659  docker container
  660  docker container ls
  661  docker container ls -l
  662  docker container ls -l
  663  docker container ls
  664  docker container ls -a
  665  clear
  666  docker container ls -a
  667  docker container start fed549e69e9d
  668  docker container ls
  669  docker container stop tender_ardinghelli
  670  docker container ls
  671  docker container ls -a
  672  clear
  673  docker container ls -a
  674  docker container start c165f459e7d7
  675  docker container stop 151a77679241
  676  docker container start c165f459e7d7
  677  docker container logs c165f459e7d7
  678  docker container logs c165f459e7d7
  679  docker container logs c165f459e7d7
  680  docker container logs c165f459e7d7
  681  docker container ls
  682  docker container ls -a
  683  docker container rm fed549e69e9d
  684  docker container ls -a
  685  docker container prune
  686  docker container ls -a
  687  docker container inspect 0967ba7aa180
  688  docker images
  689  docker image history f8049a029560
  690  clear
  691  docker images
  692  docker image history in28min/todo-rest-api-h2
  693  docker image history in28min/todo-rest-api-h2:1.0.0.RELEASE
  694  docker images
  695  docker image remove f8049a029560
  696  docker image remove 3094afcbdf12
  697  docker container stop c165f459e7d7
  698  docker image remove 3094afcbdf12
  699  docker container rm c165f459e7d7
  700  docker image remove 3094afcbdf12
  701  docker images
  702  docker containers ls
  703  docker container ls
  704  docker container ls -a

Step 03 - How does Docker work?

Docker Architecture

Docker Architecture

Step 04 - Manually creating a new docker image

  716  docker run -dit openjdk:8-jdk-alpine
  720  docker container cp target/docker-in-5-steps-todo-rest-api-h2-1.0.0.RELEASE.jar 28d5e5d893fdb1530e9920ff66fee252adc834a8b572b77b3fdf7d316730127c:/tmp
  725  docker container exec romantic_aryabhata ls /tmp
    734  docker container commit romantic_aryabhata in28min/manual-todo-rest-api:v1
  735  docker container commit --change='CMD ["java","-jar","/tmp/docker-in-5-steps-todo-rest-api-h2-1.0.0.RELEASE.jar"]' romantic_aryabhata in28min/manual-todo-rest-api:v2
  743  docker run -d -p 5000:5000 in28min/manual-todo-rest-api:v2

Step 05 : Containerizing Spring Boot Application using Dockerfile and Spotify Maven Plugin

Run com.in28minutes.rest.webservices.restfulwebservices.RestfulWebServicesApplication as a Java Application.

  • mvn package
  • docker run -d -p 5000:5000 in28min/docker-in-5-steps-todo-rest-api-h2:1.0.0.RELEASE
  • docker login
  • docker push in28min/docker-in-5-steps-todo-rest-api-h2:1.0.0.RELEASE

Troubleshooting

Creating Containers

To test execute API at http://localhost:5000/users/in28minutes/todos.

docker login

Hello World URLS

Hello World
{"message":"Hello World - Changed"}
{"message":"Hello World, in28minutes"}

Todo JPA Resource URLs

[
  {
    "id": 10001,
    "username": "in28minutes",
    "description": "Learn JPA",
    "targetDate": "2019-06-27T06:30:30.696+0000",
    "done": false
  },
  {
    "id": 10002,
    "username": "in28minutes",
    "description": "Learn Data JPA",
    "targetDate": "2019-06-27T06:30:30.700+0000",
    "done": false
  },
  {
    "id": 10003,
    "username": "in28minutes",
    "description": "Learn Microservices",
    "targetDate": "2019-06-27T06:30:30.701+0000",
    "done": false
  }
]
Retrieve a specific todo
{
  "id": 10001,
  "username": "in28minutes",
  "description": "Learn JPA",
  "targetDate": "2019-06-27T06:30:30.696+0000",
  "done": false
}
Creating a new todo
{
  "username": "in28minutes",
  "description": "Learn to Drive a Car",
  "targetDate": "2030-11-09T10:49:23.566+0000",
  "done": false
}
Updating a new todo
{
  "id": 10001,
  "username": "in28minutes",
  "description": "Learn to Drive a Car",
  "targetDate": "2045-11-09T10:49:23.566+0000",
  "done": false
}
Delete todo

H2 Console

More Repositories

1

devops-master-class

Devops Tutorial for Beginners - Learn Docker, Kubernetes, Terraform, Ansible, Jenkins and Azure Devops
Java
2,203
star
2

spring-microservices

Microservices using Spring Boot, Spring Cloud, Docker and Kubernetes
Java
1,770
star
3

java-tutorial-for-beginners

Java Tutorial For Beginners with 500 Code Examples
1,312
star
4

java-best-practices

Best practices in Coding, Designing and Architecting Java Applications
1,254
star
5

master-spring-and-spring-boot

Spring and Spring Boot Tutorial For Absolute Beginners - 10-in-1 - Spring to Spring Boot to REST API to Full Stack to Containers to Cloud
Java
1,226
star
6

spring-boot-examples

Code Examples for everything thats written on www.springboottutorial.com
Java
1,207
star
7

spring-master-class

An updated introduction to the Spring Framework 5. Become an Expert understanding the core features of Spring In Depth. You would write Unit Tests, AOP, JDBC and JPA code during the course. Includes introductions to Spring Boot, JPA, Eclipse, Maven, JUnit and Mockito.
Java
1,142
star
8

java-a-course-for-beginners

Java Programming Tutorial for Beginners
JavaScript
1,044
star
9

JavaInterviewQuestionsAndAnswers

Java Interview Questions and Answers
Java
973
star
10

spring-boot-master-class

Understand and love the power of Spring Boot - All its features are illustrated developing a web application managing todos and a basic API for survey questionnaire. Also covers unit testing, mocking and integration testing.
Java
965
star
11

course-material

Course Material for in28minutes courses on Java, Spring Boot, DevOps, AWS, Google Cloud, and Azure.
947
star
12

SpringMvcStepByStep

Spring MVC Tutorial for beginners - In 25 Small Steps
Java
828
star
13

spring-microservices-v2

Microservices + Spring Boot 2 + Spring Cloud + Docker + Kubernetes - https://www.udemy.com/course/microservices-with-spring-boot-and-spring-cloud/. Latest Repo - http://github.com/in28minutes/spring-microservices-v3
JavaScript
714
star
14

learn

How do you achieve your career objectives? Complete career paths with amazing Cloud, Full Stack and Microservice Courses and Videos from in28Minutes
685
star
15

SpringIn28Minutes

Spring Tutorial For Beginners
Java
657
star
16

spring-interview-guide

200+ Questions and Answers on Spring, Spring Boot and Spring MVC
JavaScript
642
star
17

MockitoTutorialForBeginners

Mockito Tutorial for Beginners
Java
632
star
18

jpa-with-hibernate

Master JPA using Hibernate as the implementation. Learn the basics of JPA - entities, relationships, entity manager, annotations, JPQL and Criteria API. Take a step into the advanced world of JPA - caching, performance tuning(n + 1 queries), mapping inheritance hierarchies. Get a peek into the magic of Spring Data JPA & Spring Data Rest.
Java
630
star
19

SpringBootForBeginners

Spring Boot Tutorial For Beginners
Java
609
star
20

full-stack-with-react-and-spring-boot

Your First Full Stack Application with React and Spring Boot
Java
606
star
21

full-stack-with-angular-and-spring-boot

Your First Full Stack Application with Angular and Spring Boot
Java
605
star
22

in28minutes-initiatives

All initiatives to build a connect between industry, instructors and learners
596
star
23

java-cheat-sheet

Java Tutorial For Beginners - Companion Reference
588
star
24

JavaWebApplicationStepByStep

JSP Servlets Tutorial For Beginners - in 25 Steps
Java
534
star
25

spring-web-services

Spring Web Services - SOAP and RESTful
Java
532
star
26

spring-unit-testing-with-junit-and-mockito

Spring Unit Testing with JUnit and Mockito
Java
359
star
27

docker-crash-course

Docker for beginners - with Java and Spring Boot Applications and Microservices
Java
350
star
28

functional-programming-with-java

Learn Functional Programming with Java using a Hands-on Step by Step Approach
Java
340
star
29

kubernetes-crash-course

Learn Kubernetes and Docker with Google Kubernetes Engine deploying Spring Boot Microservices
Java
327
star
30

interview-guide

Java interview guide - 200+ Question and Answers
297
star
31

deploy-spring-microservices-to-aws-ecs-fargate

Take your first steps towards cloud with AWS ECS Fargate. Deploy REST APIs and Microservices with Spring Boot and Docker Containers to the cloud.
Java
265
star
32

SpringBootWebApplicationStepByStep

Develop your first web application with Spring Boot Magic
Java
256
star
33

spring-boot-react-fullstack-examples

All full stack examples with Spring Boot and React for articles on our website http://www.springboottutorial.com
JavaScript
255
star
34

roadmaps

Roadmaps of in28minutes courses!
245
star
35

spring-microservices-v3

JavaScript
228
star
36

JUnitIn28Minutes

JUNIT Tutorial For Beginners
Java
216
star
37

automation-testing-with-java-and-selenium

Learn Automation Testing with Java and Selenium
HTML
193
star
38

MavenIn28Minutes

Maven Tutorial for Beginners with Examples
Java
193
star
39

python-tutorial-for-beginners

Python Tutorial for Beginners with 500 Code Examples
182
star
40

in28minutes.github.io

Spring Boot Tutorials
HTML
171
star
41

deploy-spring-boot-aws-eb

Deploying Spring Boot Apps to AWS using Elastic Beanstalk
Java
160
star
42

getting-started-in-5-steps

How to install and get started with Java, Eclipse, Maven, JUnit, Mockito & Spring in 5 easy steps
JavaScript
154
star
43

clean-code

Learn to Write Clean Code with Java. Get Hands-on with 20+ Code Examples involving 4 principles of Simple Design, Refactoring and TDD.
JavaScript
153
star
44

first-steps-to-software-architect

How to start your journey towards software architecture?
136
star
45

MockitoIn28Minutes

Learn Mockito from In28Minutes
Java
121
star
46

learning-paths-cloud-and-devops

How to learn Cloud and DevOps
119
star
47

spring-boot-angular-fullstack-examples

All full stack examples with Spring Boot and Angular for articles on our website http://www.springboottutorial.com
TypeScript
109
star
48

in28Minutes-Course-Roadmap

A Roadmap for our Courses. Remember we focus on Java, Microservices, Web Applications and are big Spring Shop - Spring, Spring MVC, Spring Boot, Spring Cloud...
104
star
49

pcf-crash-course-with-spring-boot

PCF Crash Course for Java, Spring and Spring Boot Developers - Deploy Spring Boot REST API, Full Stack Applications and Microservices to Pivotal Cloud Foundry (PCF)
Java
98
star
50

azure-devops-kubernetes-terraform-pipeline

https://github.com/in28minutes/devops-master-class
Java
87
star
51

deploy-spring-boot-to-azure

Deploy Spring Boot Applications to Azure Web Apps
Java
82
star
52

camel

Learn Enterprise Integration Patterns with Apache Camel
JavaScript
80
star
53

Design-Patterns-For-Beginners

Design Patterns for Beginners
80
star
54

JavaObjectOrientedProgramming

Learn basics of object oriented programming with Java
Java
69
star
55

learn-programming-with-python-

learn-programming-with-python​
Python
67
star
56

10-Steps-to-High-Quality-Java-Developer

You Key to Becoming a High Quality Java Developer
61
star
57

java-to-python-in-100-steps

Learn Python using your Java Knowledge
Python
58
star
58

java-technology-for-beginners

In my 15 years of designing and developing more than 100 java web applications, there are a number of terminologies, standards, frameworks, tools that I have used. I know how difficult it is for a beginner to understand them. And imagine the trouble non techies face - the business, testing teams and others. So, this guide is to demystify these terms! Enough talk. Let's Rock and Roll......
58
star
59

spring-boot-vuejs-fullstack-examples

All full stack examples with Spring Boot and Vue JS for articles on our website http://www.springboottutorial.com
Java
57
star
60

EclipseIn28Minutes

Eclipse Tutorial for Beginners - From in28Minutes
53
star
61

jenkin-devops-microservice

https://github.com/in28minutes/devops-master-class
Java
49
star
62

spring-complete-career-path

Level 1 covers Basics of Spring Developing a web application with Spring MVC Basics of Spring Boot - Autoconfiguration, Starter Projects Basic Todo Management Application with Login/Logout Model, Controllers, ViewResolver and Filters Forms - DataBinding, Validation Bootstrap to style the page Spring Security Exception Handling Level 2 (coming soon) will cover Rest APIs with Spring Boot SOAP Web Services with Spring Boot. Level 3 (coming soon) will cover Spring Cloud Microservices
Java
44
star
63

go-serverless

Go Serverless with AWS Lambda and Azure Functions - Udemy Course https://www.udemy.com/course/serverless-tutorial-aws-lambda-and-azure-functions
JavaScript
41
star
64

Tips-Database

Tips about Web Services, APIs, Microservices, Spring, Spring Boot, Maven, Eclipse etc
37
star
65

TDDin28Minutes

TDD Tutorial For Beginners - from in28Minutes
Java
31
star
66

spring-boot-to-cloud

Spring Boot to Cloud (AWS, Azure, GCP and PCF) with Docker and Kubernetes
Java
30
star
67

JavaTutorialForBeginners

Java Tutorial for Beginners with examples
Java
29
star
68

BasicWebServletsIn28Minutes

Java
28
star
69

campus-interview-guide

60 Day Learning Challenges for Campus Interviews
28
star
70

CTutorialForBeginners

C Tutorial for Beginners
27
star
71

Java-EE-Design-Patterns

26
star
72

HibernateJPAStepByStep

Hibernate Tutorial For Beginners - Step by Step with Examples
22
star
73

in28minutes.com

Awesome Courses from the Best Selling Instructor
HTML
22
star
74

RealWorldWebApplicationWithServletsAndJspIn28Minutes

Learn to Develop your first web application with Servlets and JSP
Java
20
star
75

cloud.in28minutes.com

cloud.in28minutes.com
HTML
20
star
76

jenkins-pipeline

Java
18
star
77

spring-boot-rest-api-playground

Java
18
star
78

spring-microservices-v3-old

JavaScript
16
star
79

microservice-reference-archetype

Java
14
star
80

hello-world-rest-api-aws-ecs-codepipeline

Java
14
star
81

Struts2StepByStep

Learn Struts 2 Step By Step
Java
11
star
82

jshell-for-java-programmers

An introduction to JShell for Java Programmers
11
star
83

hello-world-rest-api-azure-pipelines

Java
10
star
84

in28minutes

9
star
85

getting-started-for-beginners-v2

Updated Getting Started Guides for Beginners Recorded with Spring Boot 3 - Spring, Spring Boot, JUnit, Mockito, JPA, Hibernate ....
Java
9
star
86

spring-boot-todo-rest-api-h2-aws-codepipeline

Java
8
star
87

In28MinutesTemplate

Serves as template for my new courses
8
star
88

todo-app

Java
6
star
89

automatewithselenium.com

Learn how to automate your tests with Selenium - Java, Python, C# and JavaScript - automatewithselenium.com
CSS
6
star
90

dev-config-server-test

4
star
91

config-server

2
star
92

programmingabc.com

Master Content for our Programming Website - programmingabc.com
CSS
2
star
93

Future-Course-Preparation

1
star
94

hello-world-playground

Java
1
star