I am trying to re-create the following diagram:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,fit,shadows,calc,positioning}
\begin{document}
\begin{figure}[t]
\centering
\begin{tikzpicture}[
node distance=0.1cm,
mynode/.style={
draw,
outer sep=0pt,
text centered,
text width= 2cm,
},]
\node[mynode,fill=red] (line1a) {container};
\node[mynode,fill=red] (line1b) [right=of line1a] {container};
\node[mynode,fill=red] (line1c) [right=of line1b] {container};
\node[mynode,fill=purple] (line2a)[fit = (line1a)(line1c),
below = 1cm of line1a.west,
anchor= south west, inner sep=0, label=center:{container Runtime}] {};
\node[mynode,fill=cyan] (line3a)[fit = (line2a),
below = 1cm of line2a.west,
anchor= south west, inner sep=0, label=center:{Container OS}] {};
\node[mynode,fill=gray] (line4a)[fit = (line3a),
below = 1cm of line3a.west,
anchor= south west, inner sep=0, label=center:{Physical Host (or VM)}] {};
\end{tikzpicture}
\caption{cap}
\label{figure:cap}
\end{figure}
\end{document}
I am still new to TikZ, Is there an easier way to draw it ?