diff --git a/Docker/CMakeLists.txt b/Docker/CMakeLists.txt
index ffcd9ac6b26685d858f0886fb325571cbf208579..a8ee519d482260e640b1a6d7adcdead0acd0402b 100644
--- a/Docker/CMakeLists.txt
+++ b/Docker/CMakeLists.txt
@@ -36,7 +36,7 @@ lofar_add_sbin_scripts(docker-build-all.sh)
 foreach(_dir ${DOCKER_TEMPLATE_DIRS})
   # _src -> _dst
   set(_src ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/Dockerfile.tmpl)
-  set(_dst ${CMAKE_BINARY_DIR}/bin/${_dir}_Dockerfile)
+  set(_dst ${CMAKE_CURRENT_BINARY_DIR}/${_dir}_Dockerfile)
 
   # add generating command, and (any) target to force the generation
   # when "all" is build.