openjdk-fips
OpenJDK-FIPS Overview
Secure your stack with a hardened OpenJDK-FIPS image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.
OpenJDK (Open Java Development Kit) is an open-source implementation of the Java Platform, Standard Edition (Java SE). It is a great default choice for Java projects requiring a Java compiler (javac) and standard Java libraries. See also the Minimus tutorial for Java and Minimus tips for multi-stage builds.
FIPS 140-3 Certification
This image is FIPS-validated to ensure its cryptographic operations meet the Federal Information Processing Standards (FIPS) required for secure government and regulated environments. Its core cryptographic modules are validated under the NIST Cryptographic Module Validation Program (CMVP) and comply with the FIPS 140-3 standard.
To verify that the FIPS 140-3 provider is configured and active, follow the instructions in the FIPS compliance tab.
Try It Out
To take the Minimus OpenJDK image for a test run, we will require both OpenJDK and OpenJRE in our Dockerfile to keep the build and runtime environments separate and include only the compiled .class in the final image. Our test will also involve a Java project with a simple program that prints a welcome message.
First, create 2 files in your directory:
- Dockerfile
- MyMinimus.java
Save the following code to your Dockerfile:
# === Build Stage ===
FROM reg.mini.dev/openjdk-fips AS builder
COPY MyMinimus.java /home/build/
WORKDIR /home/build/
RUN javac -d /home/build MyMinimus.java
# === Runtime Stage ===
FROM reg.mini.dev/openjre-fips
COPY --from=0 /home/build/MyMinimus.class /app/
WORKDIR /app/
CMD ["java", "MyMinimus"]Save the following Java script to the file MyMinimus.java. Note that for Java to compile properly, the filename must match the public class name, so be sure to save the file as MyMinimus.java.
class MyMinimus
{
public static void main(String args[])
{
System.out.println("Welcome to MyMinimus!");
}
} Next, build the custom image and run it. Note that the period . specifies the current directory as the build context:
docker build -t minimus-java-app .
docker run minimus-java-appYou should see the greeting Welcome to MyMinimus! in your terminal.
Technical Considerations
The OpenJDK-FIPS image provided by Minimus is a slim, security-hardened alternative to the public image from eclipse-temurin (since the Docker official image is deprecated). The images are largely interchangeable, with a few differences as noted below.
OpenJDK-FIPS built by Minimus:
- Runs as non-root by default for a security-first approach that protects against privilege escalation attacks. The public image runs as root.
- The entrypoint is null, while the public image entrypoint script defaults to
/__cacert_entrypoint.sh. The default CMD isjshellin both images. - The default working directory is
/home/build. For the public image, the default working directory is the root directory (/). - Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.
The Payoff
A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.
- See the risk reduction dashboard for a detailed CVE comparison over the past 30 days.
- Review the compliance report to see the default hardening and security configurations for the image.