For any commutative ring $K$, the set of all non-singular $n\times n$ matrices with entries in $K$ is the usual general linear group $\operatorname{GL}_n(K)$; moreover, each homomorphism $f:K\to K'$ of rings produces in the evident way a homomorphism $\operatorname{GL}_nf:\operatorname{GL}_n(K)\to \operatorname{GL}_n(K')$ of groups. These data define for each natural number $n$ a functor $\operatorname{GL}_n:\operatorname{CRng}\to \operatorname{Grp}$.
These lines come from MacLane, Categories for the working mathematician. What happens if I remove "commutative"? In other words, $\operatorname{GL}_n:\operatorname{Rng}\to \operatorname{Grp}$ is still a functor?
No commutativity of multiplication is necessary, and by the way also no subtraction. If $R$ is any semiring, we can form the semiring of matrices $M_n(R)$ over $R$. Clearly, this defines a functor $M_n : \mathbf{SemiRing} \to \mathbf{SemiRing}$. We also have the forgetful functor $U : \mathbf{SemiRing} \to \mathbf{Mon}$ (forgets addition) and the group of units functor $(-)^{\times} : \mathbf{Mon} \to \mathbf{Grp}$. The composition of these functors is a therefore also a functor, namely $\mathrm{GL}_n : \mathbf{SemiRing} \to \mathbf{Grp}$. You can also restrict it to the subcategory of rings.