Sign inSign up

jaschweder/azure

By jaschweder

Updated over 8 years ago

Azure CLI inside Docker image

Image
0

450

jaschweder/azure repository overview

How to use this image

At first time run you need to create all login files, to do this please run the command bellow:

docker run \
    -it \
    --rm \
    --privileged \
    -v $HOME/.ssh:/root/.ssh \
    -v $HOME/.azure:/root/.azure \
    -v $HOME/.docker:/root/.docker \
    -v /var/run/docker.sock:/var/run/docker.sock \
    jaschweder/azure \
    bash

This will create a new container and run bash inside of it, you need to run this two other commands to generate your authentication files.

Login at Azure:

az login

Login at Azure ACR:

az acr login --name <your-registry>

This will generate some files that are stored in ~/.docker and ~/.azure, this files will be saved at your local machine because of the volumes binds.

After doind this you can add this script to the end of your ~/.bashrc file.

function azdocker() {
    docker run \
        -it \
        --rm \
        --privileged \
        -v $HOME/.ssh:/root/.ssh \
        -v $HOME/.azure:/root/.azure \
        -v $HOME/.docker:/root/.docker \
        -v /var/run/docker.sock:/var/run/docker.sock \
        jaschweder/azure \
        docker \
        "$@"
}

Then reload your .bashrc file.

. ~/.bashrc

Now you can run azdocker to access remote azure command. Really awesome!!!

azdocker pull <your-registry>/<some-image>
Maintainer

Jonathan A. Schweder [email protected]

Tag summary

Content type

Image

Digest

Size

412.8 MB

Last updated

over 8 years ago

docker pull jaschweder/azure