Internet of Things (IoT), an emerging technology, connects billions of smart devices to the Internet through heterogeneous communication technologies enabling novel services and applications. This complex and variable environment encounters several challenges such as managing and controlling the network and IoT applications, programming IoT devices, responding to some specific Quality of Service requirements of certain applications. The current IoT network based on the complex, static, and closed traditional architecture represents a serious concern, especially with the amounts of data generated from the huge and heterogeneous IoT devices. In this paper, we present a new model for IoT architecture that brings together the benefits of Software Defined Networking (SDN) architecture and containerization (i.e., Docker) to address most IoT challenges and abstract the underlying communication and hardware subsystem. The SDN concept decoupled the control plane from data plane which implies a centralized global network view and provides flexibility in network configuration and resource management. Moreover, containerization technique through the docker in the device brings the portability and scalability of the applications. First, we propose, an SDN-based architecture for IoT. Then, with lightweight virtualization of IoT device supplied by Docker, we empower the functionalities and effectiveness of the SDN based architecture solution to challenge the IoT heterogeneity. Furthermore, we use the smart supermarket as a use case to validate our SDN-Docker based architecture in a real IoT scenario. The experimental results validate the architecture implementation.