[RELAND] .circleci: Improve docker image build workflow (#38279)
Summary:
This reverts commit 7c2853be9dccc7a1ae80a2a421e63e254cd7797c.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38279
Differential Revision: D21517822
Pulled By: seemethere
fbshipit-source-id: 5f705f6c617cbc77a10ab9deb913bc5958ae7439