Share a Docker image without using a Docker registry

This is useful for sharing personal Docker images or to import it to a secure environment with no Internet connection. Example: # Export Docker image to a .tar file docker save thingsandcode.com/thingsandcode-web:20220830-pro > /tmp/thingsandcode-web_20220830-pro.tar # Import .tar file to local Docker installation docker load --input /tmp/thingsandcode-web_20220830-pro.tar

Continue reading...

Copy a Docker image from one registry to another

Copying docker images is useful to prevent losing access to an image if the remote registry goes down or to move images between environments (For example: from testing to production) The process consists in pulling an image from an origin repository, change the tag, and push the image to a remote repository. Example: # Login...

Continue reading...

Restart an Openshift deployment or deployment config

The easiest way to restart is reducing the number of pods to zero and increase again up to the desired pod count: oc get deployment thingsandcodeDeployment # Shows the current number of pods oc scale deployment thingsandcodeDeployment --replicas=0 # Stops the deployment oc scale deployment thingsandcodeDeployment --replicas=2 # Starts new pods for deployment

Continue reading...

How to use Azure what-if command to validate changes before deploying an ARM template

Changes on production are dangerous stressful processes. Fortunately, there are tools that make deployments easier and prevent disasters. In this post you will learn how to use Azure ‘what-if’ command to validate changes before deploying an ARM template. Prerequisites The command ‘What-if’ is available for Azure Powershell, Azure CLI, Azure REST API, or SDK for...

Continue reading...

How to create an Azure Keyvault secret and copy an access key using an ARM template

Projects hosted in Azure should store passwords and other sensitive information in a Keyvault. It’s a good practice that makes an application safer because it prevents the leakage of the information in case of unauthorized access to the server. Another good practice is deploy using Infrastructure as Code (IaC) because it removes manual processes that...

Continue reading...