I want to extract the Docker image (from Ubuntu server) into my local system (Linux machine).
I run the following command
docker exec -it containername_
You can use docker's export tool for this. docker export will output the contents of a container into a .tar file;
export
docker export
$ docker export container_name > output.tar
See the docker docs for more information: https://docs.docker.com/engine/reference/commandline/export/