Running docker containerized App from Local Image

Recently I was in a problem with setting up an application to another machine, which was perfectly okay on my machine. It was a Laravel application using docker.

So when I tried to run that app on other machine I was receiving connection refused from registry server because that app database image was hosted on a server and to access it I had to install VPN and other certificates.

docker-compose up --build

It was responding me:

Pulling database ( ERROR: Get dial tcp connect: connection refused

After doing some debugging and checking VPN, I found that server was down for new infrastructure implementation. So how I moved forward without making that server up again.

Yes, what I did was something like, saving my local image to a tar file and import that file in docker on other machine. Steps was mostly three line like:

docker image ls #find the image name from the list
docker save phpfarmer_database > phpfarmer_database.tar #store it
docker load < phpfarmer_database.tar #import it on new machine

After that, when I run again

docker-compose up --build

It was all fine, application started on new machine. So in summary, If you have the local copy of any docker image, you can bypass registry of it and copy it on other machine to install your app.

For more:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: