As I already mentioned in my last post, I spent some time this week moving my bavaGhost install over to a new environment in Reclaim Cloud to take advantage of Taylor Jadin’s snazzy new Ghost one-click installer. Taylor and I did a fullblown stream talking about his groovy installer if you are interested in the deep-dive:
Soon after this discussion I decided to port my Ghost install to an environment using Taylor’s installer given it makes updating versions, setting up Mailgun, and mapping a domain with Let’s Encrypt dead simple. It’s the closest thing we have to a complete solution on Reclaim Cloud for running an application without feeling you need to dig into SSH and server administration.
The tale of the tape for my explorations with Ghost over the last 6 months are pretty well documented on this blog, but for quick context I was running Ghost using the Community Docker Image straight from Jelastic (no Docker Engine) with a Nginx load balancer to manage the domain mapping and SSL certificate. I did move a similar Ghost instance for Reclaim Roundup from this setup to run within Docker Engine given a bug with the SQLite database that prevented us from sending over 500 emails.
So this was my first go at playing with Taylor’s Ghost installer. The migration of posts and settings was simple. After using the Ghost installer to create a fresh instance, Ghost’s native export/import tools moved the 19 posts and various settings from one environment to the other beautifully. The only hitch was I needed to copy over about 40 MB of featured images and headers from one instance to the other. It’s at this point where I started running into issues while at the same time feeling my understanding of Docker containers in Reclaim Cloud painfully expanding. So, I’m going to take a bit to document at least two ways at the ostensibly simple task of moving a directory with 40 MBs worth of images.
[On a separate but related note, Taylor and I have been struggling with the problem of moving data between containers in Reclaim Cloud during a series of streams this week. Turns out rsyncing files between different environments in different data centers or with different environmental settings (permissions, firewall, etc.) can result in some serious frustration. The project we’re working on, porting ds106.tv from an Ubuntu VPS to a Docker instance of Peertube, highlighted some of these issues, many of which Taylor has been working through and documenting in order for us to streamline things. It’s been fun streaming it for sure, but I do feel bad for subjecting Taylor to so much PostgreSQL 🙂 ]
The above is separate but related because it highlights my concern when trying to move 40 MB of files from one container to another within Reclaim Cloud. In fact, it should be easy, right? Just zip up the folder and download it via command line, right? Well, yes and no. Yes if you knew that the custom Ghost container was running Alpine Linux and to install zip on that container you needed to run the following command:
apk add zip That would work, and the folder would be zipped up and available in the
/var/lib/ghost/ path which you could access and download via the Config area for that container:
After that you would upload the images.zip file to the new Ghost instance, which for Taylor’s installer is located at
/root/ghost/ghostdata/. You would also need to make sure zip is installed on the new server, and unzip the images directory after uploading and move the contents into the existing images folder. And while not terribly onerous, it is anything but seamless.*
While futzing with zipping directories to move all of 40 MB of files I found an option in the Config option for Reclaim Cloud node to export a directory from one container to another:
When I clicked on this option it seems to allow a link from this container to any directory of any other other container I own. This effectively solves the issue of moving content between containers in Reclaim Cloud!
Yeah! The images directory was copied to the new container as images-move.
After that, I could easily move the contents of the exported directory images-move into the images directory on the new container. This saved me from rsyncing, zipping, FTP, or any other round about means I would try to get a simple 40 MB file over to the new container. What’s more, it opens up a whole new way to moving data between containers in Reclaim Cloud that could save us a whole lot of headaches.
*I also tried rsyncing to my local desktop and then rsyncing back up to the new container, but I was getting a bit turned around so I abandoned that.