If we set $g(z)=f(z)/z$, then $g$ is analytic in $D$, and $g(0)=f'(0)$, and as $|f'(0)|<1$, then for $$a=\frac{|f'(0)|+1}{2}<1,$$ there is an $r_0\in(0,1]$, such that $|g(z)|\le a$, and hence
$$
|f(z)|\le a|z|,
$$
for all $|z|\le r_0$, which in turn implies that
$$
|f^{n\circ}(z)|\le a^n |z|\le a^n r_0\to 0 \tag{1}
$$
uniformly in $\overline D_{r_0}=\{z: |z|\le r_0\}$, where
$f^{n\circ}=\underbrace{f\circ f\circ \cdots \circ f}_{n\,\,\,\text{times}}$.
In order to show that $f^{n\circ}\to 0$, locally uniformly in $D$, it suffices to show every subsequence of $\{f^{n\circ}\}$ contains a sub-subsequence which converges to $0$ locally uniformly in $D$.
Let $\{h_n\}$ a subsequence of $\{f^{n\circ}\}$ and $K\subset D$ compact. Then $K\subset \bar D_r$, for some $r<1$. Let $r_1\in(r,1)$. Then $|h_n(z)|\le 1$, for $|z|=r_1$, and hence since
$$
h_n'(z)=\frac{1}{2\pi i}\int_{|z|=r_1}\frac{h_n(\zeta)\,d\zeta}{(\zeta-z)^2},
$$
for every $z\in K$, then
$$
|h_n'(z)|\le\frac{1}{2\pi}\cdot 2\pi r_1 \cdot 1 \cdot\frac{1}{(r_1-r)^2}=\frac{r}{(r_1-r)^2},
$$
for every $z\in K$. This implies that $\{h_n\}$, when restricted to $K$, is equicontinuous, and due to Arzelà–Ascoli theorem it is precompact, and thus $\{h_n\}$ possesses a convergent subsequence. Repeating this procedure for $K_j=\overline{D}_{1-2^{-j}}$, and using a suitable diagonal argument we can pick a subsequence, call it also $\{h_n\}$ which converges locally uniformly in $D$ to an analytic function $h$. But $h_n=f^{k_n\circ}$, for some $k_n\ge n$, and due to $(1)$, $h_n\to 0$ uniformly in $\overline D_{r_0}$. Thus $h\equiv 0$ in $\overline D_{r_0}$, and consequently $h\equiv 0$ in $D$.