The #1 cost is increased complexity and opportunity cost of converting your simple app to an interesting serverless/nosql/microservices/etc distributed system. Of course the financial savings can be heroic and justify the effort because everything is very expensive on AWS.
i'd contend that it's much worse. One (Docker) is a piece of software, one (Amazon) is a corporation with a motivated will.
They are two different problems. One is basically the problem of copy-paste/stackoverflow developers, the other is a walled garden problem that'll make itself worse over time.
I don't know if these fears ever actually pan out. In the 90s we had a world full of kids learning on Windows, and many of them later in their career switched to Linux or Mac. In the 2000s we had a world of kids learning Rails and plenty of them moved on to Javascript or Clojure or Python. The world was no worse for their first experience, and alternative tools did not cease to exist.
The people who learn on AWS and have an actual desire to continue their knowledge will always find ways to continue their knowledge. Learning on AWS first is not going to stop that.