Reputation: 1330
On a Ubuntu machine, I have built a docker image of a Python flask project and saved it locally on a folder.
/docker-images/my_flask_project.tar
When I run this using this command -
sudo docker run -d -p 8000:8000 my_flask_project
the error message is -
Unable to find image 'my_flask_project:latest' locally
This is the output for sudo docker images
-
REPOSITORY TAG IMAGE ID CREATED SIZE
my_flask_project latest a81f138bbf93 17 hours ago 1.31GB
<none> <none> d43c7afba099 17 hours ago 1.19GB
Upvotes: 0
Views: 545
Reputation: 416
If you want to share it via a USB in a tar file format, you can use the docker save
option and then ask your friend to use the docker load
option.
$ docker save -o filename.tar image_name:tag && gzip filename.tar
This will give a tar.gz file which will be less in size than the tar file as we are compressing it.
Transfer the tar.gz file to the USB drive. Once your friend has transferred the tar.gz file on their system, execute the below command.
$ docker load < filename.tar.gz
This will load the docker image locally into docker's local image store.
Upvotes: 1
Reputation: 4328
One approach concerning image sharing is using Dockerhub private repository:
Set up private repository: https://docs.docker.com/docker-hub/repos/
Login to dockerhub: https://docs.docker.com/engine/reference/commandline/login/
Push desired image:
docker push NAME[:TAG]
Upvotes: 1