Fix #7979, refactor constants and ajust build tag combinations
Revert "Workaround docker/docker#7979"

This reverts commit c9df74668d533e55f6cf1365c06ca53044116a72.