Intro to Docker [with Java Examples]

    14
    50



    An introduction to @Docker 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: https://docs.docker.com/get-docker/
    Github Repo: https://github.com/daliasheasha/HelloWorldDocker

    Watch Intro to Docker PART 2 on Networking, Docker Compose: https://youtu.be/_m9JYAvFB8s

    Docker in IntelliJ IDEA: https://youtu.be/ck6xQqSOlpw
    Download IntelliJ IDEA: https://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 (https://twitter.com/DaliaShea)

    Categories:#IntelliJIDEA #Docker #DockerHub

    source

    Previous articleSetup Kubernetes Master and Worker Node on AWS-Hindi/Urdu |Lec-47 |Install Kubernetes step by step
    Next article앤서블 기초 -앤서블 (Ansible) 설치하기 (1편)

    50 COMMENTS

    1. 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 <<image_name>>:<<version_number>>

    2. 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.