Please refer to the tutorial here
cd dockerize-tutorial/swbuilder/
./build_docker_image.sh
docker image ls # resulting image will be swbuilder:v1
cd dockerize-tutorial
./build.sh ~/repos/dockerize-tutorial/example_workdir
cd dockerize-tutorial
./shell.sh ~/repos/dockerize-tutorial/example_workdir