├── .gitignore
├── .idea
├── .gitignore
├── description.html
├── project-template.xml
├── encodings.xml
├── modules.xml
└── misc.xml
├── README.md
├── Dockerfile
├── src
└── Main.java
└── HelloWorldDocker.iml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Project exclude paths
2 | /out/
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main() method
--------------------------------------------------------------------------------
/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HelloWorldDocker
2 | A simple Hello World application that runs on Docker. Check out my [Intro to Docker Video](https://youtu.be/FzwIs2jMESM) that goes with it!
3 |
4 | [](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
5 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Use the OpenJDK 11 image as the base image
2 | FROM openjdk:11
3 |
4 | # Create a new app directory for my application files
5 | RUN mkdir /app
6 |
7 | # Copy the app files from host machine to image filesystem
8 | COPY out/production/HelloWorldDocker/ /app
9 |
10 | # Set the directory for executing future commands
11 | WORKDIR /app
12 |
13 | # Run the Main class
14 | CMD java Main
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Main.java:
--------------------------------------------------------------------------------
1 | public class Main {
2 |
3 | public static void main(String[] args) {
4 | System.out.println("Hello World!");
5 | int count = 0;
6 | try {
7 | while (true) {
8 | Thread.sleep(2*1000);
9 | System.out.println("I'm still here! Iteration " + count++);
10 | }
11 | } catch (InterruptedException e) {
12 | e.printStackTrace();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/HelloWorldDocker.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------