Sign inSign up

dreamy236/java_env

By dreamy236

•Updated over 1 year ago

Simple java environment generator image for developing use case.

Image
Developer tools
Web servers
2

107

dreamy236/java_env repository overview

⁠Java environment generator

Simple java environment generator image. Uses latest ubuntu and latest sdkman version to generate java specific environments, version 2 only support SpringBoot and Quarkus project creation or installation through the docker compose or cli.

⁠v1

  • Baseline version, only useful for certain cases.
  • Starts from ubuntu:latest and afterwards installs sdkman for later use.

⁠v2

  • Starts from ubuntu:latest, afterwards it installs sdkman for later use. This version features a more complete control over customization, it includes the possibility to indicate the java version installs it, create a simple springboot or quarkus application and passthrough dependencies names to the cli.
⁠Environment Variables
  • APP_NAME, optional only if you need to create a basic app. If left blank app won't generate
  • FRAMEWORK, optional only if you want to install latest SpringBoot or Quarkus. If left blank no framework will be installed.
  • JAVA_VERSION, optional only if you want to install a certain java version. If left blank no java version will be installed.
  • QK_DP, optional stands for quarkus dependencies. Will be passed to the cli to generate the app with the dependencies. If left blank will use resteasy-reactive dependency.
  • SB_DP, optional stands for sprinboot dependencies. Will be passed to the cli to generate the app with the dependencies. If left blank will use web,data-jpa dependencies.
  • GIT_CLONE, optional the container will try to clone the repository if possible.
  • GIT_TOKEN, optional the access_token for the repository. Not really used when cloning just an extra to have the access token at hand.
⁠Examples
  • For a Quarkus project enviroment example:
services:
    quarkus_java_21:
        image: 'dreamy236/java_env:v2'
        ports:
            - '8080:8080'
        container_name: quarkus_java_21
        stdin_open: true
        environment:
          - JAVA_VERSION=21.0.1-amzn
          - APP_NAME=testing-quarkus
          - FRAMEWORK=quarkus
          - QK_DP=resteasy-reactive,hibernate-orm,resteasy-jsonb
        tty: true
        restart: always
  • For a SpringBoot project environment example:
services:
    quarkus_java_21:
        image: 'dreamy236/java_env:v2'
        ports:
            - '8080:8080'
        container_name: quarkus_java_21
        stdin_open: true
        environment:
          - JAVA_VERSION=21.0.1-amzn
          - APP_NAME=testing-spring
          - FRAMEWORK=spring
          - SB_DP=web,data-jpa
        tty: true
        restart: always

⁠Extras

If the container is not attaching the port correctly, or you try to test an API using localhost: and it just says theres nothing running.

  • Quarkus example:

Add this line inside the application.properties

%dev.quarkus.http.host=0.0.0.0

This will tell the quarkus app to attach to any host port assigned, but only for the dev environment.

Tag summary

Content type

Image

Digest

sha256:f90e2cbeb…

Size

146.7 MB

Last updated

over 1 year ago

docker pull dreamy236/java_env:v2