Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to Move Docker Images between Hosts

    How to Move Docker Images between Hosts

    By RahulMarch 3, 20162 Mins Read

    In our previous tutorials you have learned about installation of Docker engine on CentOS/RHEL and Ubuntu operating system and pulled images from Docker hub. After that created containers with images. This tutorial will help you to export and import Docker images and move them between hosts.

    Advertisement

    List Docker Images

    Fist list docker images on your system using below command.

    [email protected]:~# docker images
    
    REPOSITORY     TAG        IMAGE ID            CREATED          VIRTUAL SIZE
    centos         latest     2933d50b9f77        11 days ago      196.6 MB
    ubuntu         latest     36248ae4a9ac        11 days ago      188 MB
    

    Save or Archive Image

    Now use the following command to save image repository named ubuntu (image id: 36248ae4a9ac) and make a zipped archive named ubuntu-latest.tar.gz. Remember that save is used for making backup of docker images (not containers).

    # docker save ubuntu | gzip > ubuntu-latest.tar.gz
    

    Import Image

    After saving docker image in archive format on your system move it to remote system using scp or ftp. After that use below command on remote system to import Docker image with name ubuntu and tag name latest.

    # zcat ubuntu-latest.gz | docker import - ubuntu:latest
    

    The above command will create a docker image with name ubuntu and tag name latest on your system. You can now launch containers using this image like below.

    # docker run -i -t ubuntu /bin/bash
    

    containers Docker Docker Images
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    What are the difference between SH and BASH

    What are the difference between SH and BASH?

    How to Deploy PHP, Apache, and MySQL with Docker Compose

    Understanding the Zombie Processes in Linux

    View 1 Comment

    1 Comment

    1. sam on March 4, 2016 6:43 am

      Its working for me.
      Thanks

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Setting and Getting the Default Timezone in Python
    • What is Media Access Control (MAC) Address?
    • What is Cross-Site Scripting (XSS)?
    • What is Content Security Policy (CSP)?
    • A User’s Guide to Understanding Redirection Operators in Bash
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.