Both of these forms are acceptable as prepositions. Thus you can say The barge lay alongside (or alongside of) the pier