diff --git a/Makefile.include b/Makefile.include
index 50cb94a6cfa82f7a0633b7f5d411f9ca54603aa4..e096fad83fb1e1f9c5af9973a6756ce3e5c3e98b 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -483,7 +483,7 @@ endef
 
 # The `clean` needs to be serialized before everything else.
 ifneq (, $(filter clean, $(MAKECMDGOALS)))
-    all $(BASELIBS) $(USEPKG:%=$(RIOTPKG)/%/Makefile.include) $(BUILDDEPS): clean
+    all $(BASELIBS) $(USEPKG:%=$(RIOTPKG)/%/Makefile.include) $(BUILDDEPS) ..in-docker-container: clean
 endif
 
 .PHONY: pkg-prepare pkg-build pkg-build-%