Virtualization technologies provide solutions for cloud computing. Virtual resource scheduling is a crucial task in data centers, and the power consumption of virtual resources is a critical foundation of virtualization scheduling. Containers are the smallest unit of virtual resource scheduling and migration. Although many practical models for estimating the power consumption of virtual machines (VMs) have been proposed, few power estimation models of containers have been put forth. In this paper, we propose a fast-training piecewise regression model based on a decision tree for VM power metering and estimate the power of containers configured on the VM by treating the container as a group of processes on the VM. We select appropriate features from the collected metrics of VMs/containers to help our model fit the nonlinear relationship between power and features well. Besides, we optimize the leaf nodes of the regression tree, realizing the effective power metering of virtualization environments. We evaluate the proposed model on 13 tasks in PARSEC and compare it with several commonly used models in data centers. The experimental results prove the effectiveness of the proposed model, and the estimated power of containers is in line with expectations.