title: docker-compose save/load images to another host
body: <p>I have found <a href="https://stackoverflow.com/questions/35024216/moving-docker-compose-containersets-around-between-hosts">this</a>, but it does not work for me.</p>
  <p>My (really) simple <code>docker-compose.yml</code>:</p>
  <pre><code>version: '3.1'
  
  services:
  
    wordpress:
      image: wordpress
      restart: always
      ports:
        - 8080:80
      environment:
        WORDPRESS_DB_PASSWORD: example
  
    mysql:
      image: mysql:5.7
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: example
  </code></pre>
  <p>Starting:</p>
  <pre><code>docker-compose up
  </code></pre>
  <p>After made some change to containers (install plugins and themes on wordpress).</p>
  <pre><code>docker-compose stop
  docker commit main_mysql_1 test-mysql
  docker commit main_wordpress_1 test-wordpress
  docker save test-mysql &gt; test-mysql.tar
  docker save test-wordpress &gt; test-wordpress.tar
  </code></pre>
  <p>Save the two tar files on another machine and load them:</p>
  <pre><code>docker load -i ./test-mysql.tar
  docker load -i ./test-wordpress.tar
  </code></pre>
  <p>Now change the <code>docker-compose.yml</code> to:</p>
  <pre><code>version: '3.1'
  
  services:
  
    wordpress:
      image: test-wordpress
      restart: always
      ports:
        - 8080:80
      environment:
        WORDPRESS_DB_PASSWORD: example
  
    mysql:
      image: test-mysql
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: example
  </code></pre>
  <p>But the container started is wordpress from scratch. Nothing of work done (plugin, themes, etc) was preserved.</p>
  <p>What is my mistake? I don't want to use online repository for these private purposes.. Could you suggest a more simple and powerful procedure for pass container between two hosts?</p>
  <hr />
  <p>A workaround with volumes:</p>
  <pre><code>version: '3.1'
  
  services:
  
    wordpress:
      container_name: GREB_wordpress      
      image: wordpress
      restart: always
      ports:
        - 8080:80
      environment:
        WORDPRESS_DB_PASSWORD: example
      volumes:
        - ./www:/var/www/html  
  
    mysql:
      container_name: GREB_mysql
      image: mysql:5.7
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: example
      volumes:
        - ./mysql_data:/var/lib/mysql  
  </code></pre>