sábado, dezembro 18, 2021

Docker Commands

Some docker commands for reference:

Commands:

# List images
docker images

# Run a docker
docker run imageID

# List the docker container that is running
docker ps

# Check the docker IP
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ContainerID

# Build a docker (look for a docker file)
docker build .

# Tag your local image image
docker tag ImageID name

# Tag to Remote repository (node17 repository)
docker tag node17 myr.azurecr.io/node17

# Push to remote Azure container registry (node17 repository)
docker push myr.azurecr.io/node17

# Delete all containers
docker rm $(docker ps -a -q) 
 
# Delete all images
docker rmi $(docker images -a -q)
 


domingo, dezembro 05, 2021

Import Local Repository to Azure DevOps (GIT)

These are the steps to import the local repository to my Azure DevOps organization.

I have my local repository on C:\Repos\angular-app

 

 For this example I will use Azure CLI. More information about Azure CLI please, check the link below:

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli

Be sure that you add the Azure DevOps CLI extension with the command bellow:

> az extension add --name azure-devops

Login on Azure DevOps using PAT:

> az devops login --organization https://dev.azure.com/myorg

Select your organization and Project:

> az devops configure --defaults organization=https://dev.azure.com/myorg project=myproject

Create your repo (In my example AngularHelloWorld)

> az repos create --name AngularHelloWorld

You can find the details on the Azure devOps to push an existing repository from command line, in my example I just type (In the directory where I have the repository):

>git push -u orign -all

 Now I can see in files on Azure DevOps Repo: