Docker can be run either in default ‘attached mode’ or in ‘detached mode’. The attached mode runs the program in the foreground while detached runs it in the background.