How to run Java in a Docker container - Ubuntu Environment

preview_player
Показать описание
I showcase how we can set up a docker file that can build a docker image that can run a docker container that runs a simple "Hello World!" java program. I think docker is a very interesting concept and hope more people will use it in the future.

Commands:
Build a docker image:
docker build -t [tag] [dockerfile position]

Create and run Docker container
docker run [docker image]

How to get into a docker container
docker run -it [docker image] /bin/bash

My channel publishes videos regarding programming, software engineering especially Java and JavaFX. If that is what you are looking for then do not hesitate to join me on this journey!

Subscribe to my YouTube channel:
Рекомендации по теме
Комментарии
Автор

Thank you so much, this really helped me as I kept getting errors about not finding the class and every resource I found just told me to use an image with the java already part of it which doesn't help me learn.

whale
Автор

Hey, what if I have two folders. Say one file contains inputs against which I need to run my java program and other file is obviously our java file. So, how could we run such a java program inside docker container and show the output on the terminal.

sahilkachhap
join shbcf.ru