static
Static Overview
Secure your stack with a hardened static image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies.
Use this image in Dockerfile as a secure runtime base for self-contained, static binaries. For example, you can use this static image to run a compiled Go (Golang) binary, and build the most secure, vulnerability-free application possible. Learn how it's done
Try It Out
Before we can take the Minimus static image for a test run, we'll need a static binary to run. If you have a static binary ready on hand, you can skip the next step. Otherwise, download an example and compile the code:
gcc hello.c -o staticbin --staticIf you want to first check that your file is in fact static, run ldd staticbin (where staticbin is simply the program name). You should see the message: "not a dynamic executable".
Now you are ready to build a minimal, secure image using the Minimus static image. Save this Dockerfile to your directory:
FROM reg.mini.dev/static
# Set the user to 1000 (or any other UID/GID from your base image)
USER 1000:1000
# Set the working directory inside the container
WORKDIR /app
# Copy the static binary into the image
COPY staticbin /app/staticbin
# Set the default command to run the binary
CMD ["/app/staticbin"]It's important to explicitly set the user directive in the Dockerfile. Otherwise, Docker resets to the default user (root) and the base image's user will not be inherited.
Next, build your custom image and run it. Note that the period . specifies the current directory as the build context:
docker build -t minimus-static-image .
docker run --rm minimus-static-imageYou should see the message: "Minimus says hello world"
Technical Considerations
The static image provided by Minimus is a hardened alternative to the scratch image from Docker Hub. The images are largely interchangeable, with a few differences as noted below.
Static built by Minimus:
- The image can be used as a minimal, secure runtime base for any static, self-contained binary.
- Static only comes in one version -
latest. - Runs as non-root by default as user 1000. You'll need to explicitly set the
USERdirective in the Dockerfile for the final image to run as non-root.
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.
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.