packaged by Chainguard
Catalog Starter gives your team 5 production-grade container images, free forever, with no contract or sales call. Sign up with your work email.
Try Starter for freeChainguard Harness uses frontier models from Anthropic, OpenAI, and Google to attack a copy of your app built on hadoop. It finds exploitable, validated issues that SAST and DAST tools aren't built to find.
Minimal Wolfi-based container image for Apache Hadoop, providing HDFS, YARN and MapReduce.
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev:
Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.
Chainguard's hadoop container image is comparable to the upstream apache/hadoop image, and is designed to be a drop-in replacement for it. It keeps upstream's launch configuration:
/usr/local/bin/dumb-init -- /opt/starter.sh, upstream's script, with no default command. starter.sh writes the Hadoop configuration from environment variables, then runs the command you pass, such as hdfs namenode.hadoop user (uid 1001, primary group users, gid 100) from the /opt/hadoop working directory, with HADOOP_LOG_DIR=/var/log/hadoop and /opt/hadoop/bin on PATH.starter.sh options WAITFOR, ENSURE_NAMENODE_DIR, ENSURE_STANDBY_NAMENODE_DIR, and BYTEMAN_SCRIPT work as upstream. The byteman agent is at /opt/byteman.jar and async-profiler is under /opt/profiler.It differs from upstream in these ways:
JAVA_HOME is /usr/lib/jvm/default-jvm rather than /opt/java/openjdk.hadoop user has no sudo rights. Upstream grants it passwordless sudo for every command, which starter.sh uses to write /etc/krb5.conf when KERBEROS_ENABLED is set. With this image, the KERBEROS_ENABLED option is not supported and must be left unset: starter.sh would stop at that step and the container would exit. To run Kerberized Hadoop, mount your /etc/krb5.conf and your keytabs (for example under /etc/security/keytabs), and set Hadoop's Kerberos properties, such as hadoop.security.authentication and each daemon's principal and keytab, in its configuration.HADOOP_CONF_DIR is /etc/hadoop rather than upstream's /opt/hadoop/etc/hadoop. The installation, including /opt/hadoop/etc/hadoop, is owned by root and is read-only to the hadoop user, which owns only /etc/hadoop and /var/lib/hadoop. At every start, starter.sh copies the files in /opt/hadoop/etc/hadoop into /etc/hadoop and writes the generated configuration there. Mount individual configuration files into /opt/hadoop/etc/hadoop, for example at /opt/hadoop/etc/hadoop/core-site.xml. A directory mount there hides the shipped log4j.properties, capacity-scheduler.xml, and other defaults, and the shipped defaults overwrite same-named files mounted at /etc/hadoop. Keep HADOOP_CONF_DIR at /etc/hadoop whenever starter.sh runs: pointed at the read-only /opt/hadoop/etc/hadoop, envtoconf.py cannot write the generated files and the container exits. For the same reason, the hadoop user's home is /var/lib/hadoop rather than upstream's /opt/hadoop, so KMS's default keystore (jceks://file@/${user.home}/kms.keystore) is writable, and KMS and HttpFS keep their temporary files in /var/lib/hadoop/temp (KMS_TEMP and HTTPFS_TEMP) instead of under the installation.starter.sh runs upstream's envtoconf.py, which reads every environment variable whose second _- or .-separated field is a config format as configuration, and it fails on the conf, env, sh, and cfg formats. So a variable such as APP_ENV_SERVICE_HOST or REDIS_CONF_SERVICE_HOST stops the container at startup, as it does with upstream's image. Avoid such names, and on Kubernetes set enableServiceLinks: false in the pod spec, so that a Service named, for example, app-env cannot inject one.yarn runs from /opt/hadoop/bin/yarn, as upstream. hadoop, hdfs, and mapred are also linked into /usr/bin.The following starts the cluster from upstream's Docker quickstart: an HDFS NameNode and DataNode, and a YARN ResourceManager and NodeManager. First, write the cluster configuration. Each <FILE>_<key>=<value> variable becomes a property in the named file under HADOOP_CONF_DIR:
Start the four daemons on a shared network. ENSURE_NAMENODE_DIR makes starter.sh format the NameNode on its first start:
Wait for the NameNode to leave safe mode. With dfs.namenode.safemode.min.datanodes=1, it stays there until the DataNode has registered:
Copy a file into HDFS and run the MapReduce word count example on YARN against it:
The job's progress is logged first, and the word counts are printed last:
The NameNode web UI is at http://localhost:9870, and the ResourceManager's is at http://localhost:8088.
Configure the daemons with environment variables, as in the example above, or mount your own core-site.xml, hdfs-site.xml, yarn-site.xml, and mapred-site.xml into /opt/hadoop/etc/hadoop, where starter.sh picks them up at start. It only rewrites the files that a variable names, so you can combine mounted files and variables. A container started with a different entrypoint skips starter.sh, which leaves /etc/hadoop empty, so set HADOOP_CONF_DIR=/opt/hadoop/etc/hadoop for it.
The daemons take their maximum JVM heap from HADOOP_HEAPSIZE_MAX, for example -e HADOOP_HEAPSIZE_MAX=2g, and extra JVM flags from HADOOP_OPTS or a daemon's own variable, such as HDFS_NAMENODE_OPTS.
HDFS keeps its data under /tmp/hadoop-hadoop by default. For data that outlives the container, mount a volume that uid 1001 can write to, and point dfs.namenode.name.dir and dfs.datanode.data.dir at it.
Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.
In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
Apache-2.0
BSD-1-Clause
BSD-2-Clause
BSD-2-Clause-NetBSD
BSD-3-Clause
BSD-4-Clause-UC
Bitstream-Vera
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementChainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.
SLSA compliance at ChainguardThis image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.
PCI DSS at ChainguardA FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.