Dirichlet problems for plurisubharmonic functions on compact sets