To collapse the expanded dock bar click the collapse icon, marked by the red circle on the following screen shot, that refers to the top dock bar. However, you can collapse the left, the bottom and the right dock bar as well, clicking on the relative icons.
To expand the collapsed dock bar, click the same icon again.
Save the workspace, to make the changes permanent.