locked
Cannot start Docker in Azure Shell RRS feed

  • Question

  • When in Azure Shell I type the following

    PS Azure:\> systemctl start docker.service

    I get the following error message

    Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1) Failed to connect to bus: No such file or directory

    How can I resolve it?

    Thank you in advance



    Wednesday, February 20, 2019 8:57 PM

Answers

  • What I would like to achieve is to run a docker container that I published into an Azure ACR. 

    In my local machine I created a Docker container and was able to 'push' this container into an Azure Container Registry. 

    That Docker container IS visible inside the Azure container registry. However, how can I run the the Docker container that I was able to push into/publish into Azure.

    Hello James,

    Thanks for the additional details! Having said that most of the critical docker commands wouldn't run in the Azure Cloud Shell, you will still be able to achieve the above-quoted requirement with ACR Tasks.

    You can use ACR Quick Tasks to build and push container images on-demand, in Azure, without needing a local Docker Engine installation. That's like having docker build, docker push happen in the cloud. You can build your images from local source code or a Git repository.

    This tutorial in the official docs walks you through the steps involved. Since you already are at a point where you have your repository and images in your Azure Container Registry, you can follow from this step onwards to deploy a container to Azure Container Instances (ACI). That would involve executing this command (from Azure Cloud Shell, as per your ask):

    az container create \
        --resource-group $RES_GROUP \
        --name acr-tasks \
        --image $ACR_NAME.azurecr.io/helloacrtasks:latest \
        --registry-login-server $ACR_NAME.azurecr.io \
        --registry-username $(az keyvault secret show --vault-name $AKV_NAME --name $ACR_NAME-pull-usr --query value -o tsv) \
        --registry-password $(az keyvault secret show --vault-name $AKV_NAME --name $ACR_NAME-pull-pwd --query value -o tsv) \
        --dns-name-label acr-tasks-$ACR_NAME \
        --query "{FQDN:ipAddress.fqdn}" \
        --output table

    Note: Be sure to have the latest tag associated with the image in your repository.

    Please try it out ad let us know if you need further assistance.

    Hope this helps!



    Tuesday, February 26, 2019 6:31 PM

All replies

  • Hi James,

    Thanks for reaching out to us!

    Currently, the Docker CLI is installed in Azure Cloud shell instances but the Daemon is not. So things like docker pull, docker build, and docker push would not work. Here is a similar ask requested in the past.

    Can you please give more detail on what you want to achieve? This might help me in suggesting alternate options.


    Thursday, February 21, 2019 11:46 AM
  • Thank you very much for responding to my post!

    What I would like to achieve is to run a docker container that I published into an Azure ACR. 

    In my local machine I created a Docker container and was able to 'push' this container into an Azure Container Registry. 

    That Docker container IS visible inside the Azure container registry. However, how can I run the the Docker container that I was able to push into/publish into Azure

    Thank you very much for your help!

    Thursday, February 21, 2019 1:37 PM
  • You need to use powershell, Azure CLI, or the Portal to create a new container from your uploaded image.  

    See Quickstart: Run a container application in Azure Container Instances with the Azure CLI


    Microsoft Technology Center - Dallas
    My blog

    Thursday, February 21, 2019 1:50 PM
  • Thank you very much for your response, I tried to follow the article, ended up getting this error

    "The subscription is not registered to use namespace 'Microsoft.ContainerInstance'. See https://aka.ms/rps-not-found for how to register subscriptions."

    I do have limited rights for this subscriptions. Please let me know if the only way for me to move forward is to execute this command (there is no other way around it, correct?)

    "Register-AzResourceProvider -ProviderNamespace Microsoft.ContainerInstance"

    I do have to ask out administrator to execute this statement as I don't have sufficient rights

    Thank you once again for your time and help


    Thursday, February 21, 2019 5:35 PM
  • What I would like to achieve is to run a docker container that I published into an Azure ACR. 

    In my local machine I created a Docker container and was able to 'push' this container into an Azure Container Registry. 

    That Docker container IS visible inside the Azure container registry. However, how can I run the the Docker container that I was able to push into/publish into Azure.

    Hello James,

    Thanks for the additional details! Having said that most of the critical docker commands wouldn't run in the Azure Cloud Shell, you will still be able to achieve the above-quoted requirement with ACR Tasks.

    You can use ACR Quick Tasks to build and push container images on-demand, in Azure, without needing a local Docker Engine installation. That's like having docker build, docker push happen in the cloud. You can build your images from local source code or a Git repository.

    This tutorial in the official docs walks you through the steps involved. Since you already are at a point where you have your repository and images in your Azure Container Registry, you can follow from this step onwards to deploy a container to Azure Container Instances (ACI). That would involve executing this command (from Azure Cloud Shell, as per your ask):

    az container create \
        --resource-group $RES_GROUP \
        --name acr-tasks \
        --image $ACR_NAME.azurecr.io/helloacrtasks:latest \
        --registry-login-server $ACR_NAME.azurecr.io \
        --registry-username $(az keyvault secret show --vault-name $AKV_NAME --name $ACR_NAME-pull-usr --query value -o tsv) \
        --registry-password $(az keyvault secret show --vault-name $AKV_NAME --name $ACR_NAME-pull-pwd --query value -o tsv) \
        --dns-name-label acr-tasks-$ACR_NAME \
        --query "{FQDN:ipAddress.fqdn}" \
        --output table

    Note: Be sure to have the latest tag associated with the image in your repository.

    Please try it out ad let us know if you need further assistance.

    Hope this helps!



    Tuesday, February 26, 2019 6:31 PM