The SpaceX Crew-1 mission itself has a commander who is in charge, I suppose, during transit and landing. The ISS also has a commander. Does the commander of crew 1 have any command duties while docked? Are they like a second in command, or just some other astronaut on the station?
It is important to remember that we are talking about multiple separate spaceships with multiple separate crews docked together.
We have the ISS, which has a crew. We also have the two "halves" of the ISS, i.e. the Russian segment and the international segment, and likewise we have the international complement to the ISS crew and the Russian complement to the ISS crew.
And then we have the docked vehicles, i.e. the Soyuz and Dragon capsules, which each have their own crews. To make matters even more complex, NASA will continue buying seats on Soyuz, and Roskosmos will buy seats on Dragon (and Starliner), or rather, they will be seat-swapping to ensure dissimilar redundancy. So, you will have members of the Russian ISS crew who are also members of the Dragon crew and members of the international ISS crew who are also members of the Soyuz crew. (This is to ensure that any problems with either launch system will not leave one segment of the ISS completely uncrewed.)
At the moment, we have the following crews on board the ISS:
ISS Expedition 64
- Commander Sergey Ryzhikov
- Flight Engineer 1 Kathleen Rubins
- Flight Engineer 2 Sergey Kud-Sverchkov
- Flight Engineer 3 Michael S. Hopkins
- Flight Engineer 4 Victor J. Glover
- Flight Engineer 5 Soichi Noguchi
- Flight Engineer 6 Shannon Walker
- Commander Sergey Ryzhikov
- Flight Engineer 1 Sergey Kud-Sverchkov
- Flight Engineer 2 Kathleen Rubins
- Commander Michael S. Hopkins
- Pilot Victor J. Glover
- Mission Specialist 1 Soichi Noguchi
- Mission Specialist 2 Shannon Walker
Note that Mike Hopkins is the commander of the Crew-1 mission, but is "only" Flight Engineer 3 of the Expedition 64 mission. Also note that Kate Rubins is FE 2 of the Soyuz MS-17 mission but FE 1 of Expedition 64. And Shannon Walker is "lowest" on the totem pole of both Crew-1 and Expedition 64, but will become commander of Expedition 65 when MS-17 leaves (but Mike Hopkins will still be commander of Crew-1).
However, Mike Hopkins will be commanding Crew-1 the entire time, even while Resilience is docked. Don't forget that the capsules are used as lifeboats for emergency evacuation of the ISS, so they are always operational to at least some degree.
Going back to your question:
The SpaceX Crew-1 mission itself has a commander who is in charge, I suppose, during transit and landing.
Yes. Mike Hopkins is the commander of SpaceX Crew-1.
The ISS also has a commander.
Correct. The commander of Expedition 64 is Sergey Ryzhikov.
Does the commander of crew 1 have any command duties while docked?
He will stay as commander of SpaceX Crew-1.
Are they like a second in command, or just some other astronaut on the station?
This is the point I am making above: Expedition 64 and Crew-1 are two different missions. For Crew-1, he is still commander. For Expedition 64, he is Flight Engineer 3. There is no relation between the two.
I think, for the Russian segment, the commander of the capsule will also become the commander of the ISS if it is Russia's turn. It does not look like NASA will follow that pattern.
There is a tik-tok pattern between Roskosmos and NASA, i.e. the command will usually move back and forth between NASA and Roskosmos, with the odd commander from one of the other involved agencies (ESA, JAXA, CSA) or one of Roskosmos' partner agencies. (See How is ISS commander chosen? for some of the politics.)