How to Solve Circular Import Error in Python
Introduction To give some context, I have two python files. (Both in same folder…
March 23, 2022
Consider a scenario where you are building a docker image on your local machine and want to run it on another environment or another host. How would you take your docker image there when you don’t have a repository.
Following are the steps:
Docker provides a way to save your images in an archive bundle.
Lets assume your docker image name is: my-food-api
Command to save
docker save -o my_food_api.tar my-food-api
If your image is with some tag like latest
docker save -o my_food_api.tar my-food-api:latest
You will have a tar file with name: my_food_api.tar
I transfer this file to another linux host using scp.
scp my_food_api.tar root@my_host:/target_folder/
Now, I have the tar file
on that host. I need to load it as docker image
.
Run following command:
docker load -i /target_folder/my_food_api.tar
Now, you have that docker image loaded, you can run it the way you want using docker run
To summarize, I have made two scripts, just to make my life easy.
After I build the docker image,
saveAndScp.sh
# Save docker image and scp
rm my_food_api.tar
docker save -o my_food_api.tar my_food_api:latest
scp my_food_api.tar root@your_host:/target_folder/
refresh_image.sh
# just to be sure that no old image exist before
docker image rm my_food_api:latest
docker load -i /target_folder/my_food_api.tar
run.sh
WHatever is your run command,
docker run -it -d -p 8080:13001 -v /root/config:/apps/conf --env-file /root/application.properties my_food_api:latest
Introduction To give some context, I have two python files. (Both in same folder…
You are developing a nodejs web application having some UI and backend APIs…
Bootstrap has a simple solution to have sticky blocks in your html. I’ve given a…
Introduction In this step-by-step tutorial, we will setup strapi headless CMS…
Many times, while administering your drupal website, you must have encountered…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…