DirectorySecurity AdvisoriesPricing
Sign inTry Starter for free
Directory
hadoop logo

hadoop

packaged by Chainguard

Last changed
Start with 5 free container images

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 free
Chainguard HarnessHack your app with frontier AI

Chainguard 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.

Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for hadoop

Minimal Wolfi-based container image for Apache Hadoop, providing HDFS, YARN and MapReduce.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/hadoop:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Compatibility Notes

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:

  • The entrypoint is /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.
  • It runs as the 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.
  • The 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:

  • Like all other Chainguard Containers, it features a minimal design and has few-to-zero CVEs. It is built on Chainguard OS rather than Ubuntu, and JAVA_HOME is /usr/lib/jvm/default-jvm rather than /opt/java/openjdk.
  • The 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.
  • Hadoop's native library also loads its ISA-L erasure coding and OpenSSL codecs, alongside zlib, zstd, and bzip2. Upstream's image ships neither library, so those codecs fall back to Java there.
  • yarn runs from /opt/hadoop/bin/yarn, as upstream. hadoop, hdfs, and mapred are also linked into /usr/bin.

Getting Started

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:

cat > hadoop.env <<'EOF'
CORE-SITE.XML_fs.defaultFS=hdfs://namenode
HDFS-SITE.XML_dfs.namenode.rpc-address=namenode:8020
HDFS-SITE.XML_dfs.replication=1
HDFS-SITE.XML_dfs.namenode.safemode.min.datanodes=1
MAPRED-SITE.XML_mapreduce.framework.name=yarn
MAPRED-SITE.XML_yarn.app.mapreduce.am.env=HADOOP_MAPRED_HOME=$HADOOP_HOME
MAPRED-SITE.XML_mapreduce.map.env=HADOOP_MAPRED_HOME=$HADOOP_HOME
MAPRED-SITE.XML_mapreduce.reduce.env=HADOOP_MAPRED_HOME=$HADOOP_HOME
YARN-SITE.XML_yarn.resourcemanager.hostname=resourcemanager
YARN-SITE.XML_yarn.nodemanager.aux-services=mapreduce_shuffle
YARN-SITE.XML_yarn.nodemanager.pmem-check-enabled=false
YARN-SITE.XML_yarn.nodemanager.vmem-check-enabled=false
EOF

Start the four daemons on a shared network. ENSURE_NAMENODE_DIR makes starter.sh format the NameNode on its first start:

docker network create hadoop
docker run -d --name namenode --hostname namenode --network hadoop --env-file hadoop.env \
  -e ENSURE_NAMENODE_DIR=/tmp/hadoop-hadoop/dfs/name -p 9870:9870 \
  cgr.dev/ORGANIZATION/hadoop:latest hdfs namenode
docker run -d --name datanode --hostname datanode --network hadoop --env-file hadoop.env \
  cgr.dev/ORGANIZATION/hadoop:latest hdfs datanode
docker run -d --name resourcemanager --hostname resourcemanager --network hadoop --env-file hadoop.env \
  -p 8088:8088 cgr.dev/ORGANIZATION/hadoop:latest yarn resourcemanager
docker run -d --name nodemanager --hostname nodemanager --network hadoop --env-file hadoop.env \
  cgr.dev/ORGANIZATION/hadoop:latest yarn nodemanager

Wait for the NameNode to leave safe mode. With dfs.namenode.safemode.min.datanodes=1, it stays there until the DataNode has registered:

docker exec namenode hdfs dfsadmin -safemode wait
Safe mode is OFF

Copy a file into HDFS and run the MapReduce word count example on YARN against it:

docker exec resourcemanager bash -c '
  echo "hello hadoop hello yarn" > /tmp/words.txt
  hdfs dfs -mkdir -p /input
  hdfs dfs -put /tmp/words.txt /input/
  yarn jar /opt/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar wordcount /input /output
  hdfs dfs -cat /output/part-r-00000'

The job's progress is logged first, and the word counts are printed last:

hadoop	1
hello	2
yarn	1

The NameNode web UI is at http://localhost:9870, and the ResourceManager's is at http://localhost:8088.

Configuration

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.

Documentation and Resources

What are Chainguard Containers?

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.

Need additional packages?

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.

Learn More

Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.

Trademarks

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.

Licenses

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 agreement

Compliance

Chainguard 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 Chainguard

This image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.

PCI DSS at Chainguard

A FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.


Related images
hadoop-fips logoFIPS

hadoop-fips


Category
Application

The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.