Container technology is growing popularly among developers these days and we wonder why. Containerization of software application allows building and deloying mordern applicaiton that is scalable
According to Microsoft a container is a standard package of software that bundles an application'c code together with the related configuration files and libraries, and with the dependencies required for the app to run. This allows developers and IT pros to deploy applications seamlessly across environements.
- Solve configurations error and delpoyment error that arizes from changing your software configuration or environment. A software applicaition, its dependencies, its os and its configuration are packaged together.
-
Download a sample react application code base with docker file from here. I downloaded the react-nginx project
-
Bulid and Run the docker image with the command below utilizing docker compose
docker compose up -d
-
Go to http://localhost to test the application. Take note of the port mapping.
-
You can stop the container with the command
docker container stop <container_id>
-
Then remove the container with the command
docker container rm <container_id>
-
List the images using the command
docker images
- Now you can go to the Azure portal. Create a resource group.
- Search for Container Registry. Create a container registry. I created a container registry called azcontainer7
- In your local machine, login to azure portal using the command
az login
- Login to the azure container registry
az acr login --name <name-of-registry>
- Tag the local image with the registy url and repository name using the command below
docker tag <image-name> <registry-url>/<repository-name>
- Push the image to the repository using the command
docker push <registry-url>/<repository-name>
- Below is an image of the commands I ran to push to the container registry