Yes, Corker is retiring in 2018.
But, that means the Tennessee Republican will still be in the Senate for another year. Which means that Corker's vote -- on, say, tax reform -- is something Trump is going to need. (When you only have 52 Republican senators, you have very little margin for error and you need to do everything you can to keep those members happy.)
Why attack Corker then -- and risk making him mad? (And, Corker was mad; "It's a shame the White House has become an adult day care center. Someone obviously missed their shift this morning," he tweeted in response to Trump's tweets Sunday morning.)
Aside from Corker's one vote on tax reform -- or anything else Trump wants to get done in his first two years in office -- Corker is widely regarded in Washington as a serious person, well respected by his colleagues. Corker is also a conservative; this is no John McCain (Ariz.) or Susan Collins (Maine) that Trump is swatting at.
Corker's colleagues -- most notably Senate Majority Leader Mitch McConnell and Senate Majority Whip John Cornyn -- will watch what Trump has done this morning and wonder whether there's any point at all in trusting the President or trying to find common ground. Never forget that the Senate is an extremely clubby institution; they do not look kindly on attacks on their own.