This paper is concerned with microbubble dynamics in a viscous compressible liquid near a rigid boundary. The compressible effects are modelled using the weakly compressible theory of Wang & Blake (2010, Non-spherical bubble dynamics in a compressible liquid. Part 1. Travelling acoustic wave. J. Fluid Mech., 730, 245–272), since the Mach number associated is small. The viscous effects are approximated using the viscous potential flow theory of Joseph & Wang (2004, The dissipation approximation and viscous potential flow. J. Fluid Mech., 505, 365–377), because the flow field is characterized as being an irrotational flow in the bulk volume but with a thin viscous boundary layer at the bubble surface. Consequently, the phenomenon is modelled using the boundary integral method, in which the compressible and viscous effects are incorporated into the model through including corresponding additional terms in the far field condition and the dynamic boundary condition at the bubble surface, respectively. The numerical results are shown in good agreement with the Keller–Miksis equation, experiments and computations based on the Navier–Stokes equations. The bubble oscillation, topological transform, jet development and penetration through the bubble and the energy of the bubble system are simulated and analysed in terms of the compressible and viscous effects.