You can use Docker multi-stage builds to separate the build environment from the runtime environment. For example, you can install development dependencies (like debug tools) only in the development stage, and exclude them from the final production image.