8. A cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with edge length 2 is moving in the spatial rectangular coordinate system $O-x y z$, where vertex $A$ remains on the $z$-axis, and vertex $B_{1}$ remains on the plane $x O y$. Then the minimum length of $O C$ is $\qquad$ .
As shown in the figure, since $\triangle A B_{1} C$ is an equilateral triangle with a side length of $2 \sqrt{2}$, the distance from $C$ to $A B_{1}$, $C M=\sqrt{6}$.
Thus, when $C, O, M$ are collinear, the length of $O C$ is minimized. And $\triangle A O B_{1}$ is a right triangle, at this time we must have
$$
O A=O B_{1}=2 \Rightarrow O M=\sqrt{2} \text {, }
$$

Therefore, the minimum length of $O C$ is $\sqrt{6}-\sqrt{2}$.