locked
How to push docker-compose to Azure Container Registry? RRS feed

  • Question

  • User1846752346 posted

    Hi, I had created a simple asp.net core web api project, created a docker image and then pushed it to Azure container registry successfully. Next, I added sql server db in it using a docker-compose file. Now, I want to host this file to Azure Container Registry. Basically, I want to host these images in ACR and then select these images and run them in Azure Web App Service. 

    But when I try to push the docker-compose file, I don't see anything happening. Neither failure or success and images are not to be found on Azure Container Registry as well. I am connecting to my registry through powershell and using docker-compose push command.

    Can anyone tell me how to proceed further?

    Here is my docker-compose file:

    version:  '3.2'
    services:
      ms-sql-server:
        image: mcr.microsoft.com/mssql/server:2019-latest
        environment:
          - SA_PASSWORD=astrongpass
          - ACCEPT_EULA=Y
        ports:
          - "1433:1433"
      api:
        image: <nameofregistry>.azurecr.io/aspnetcore/demoapp
        ports: 
          - "8080:80"
        depends_on: 
          - ms-sql-server

    Tuesday, March 16, 2021 7:36 PM

All replies

  • User-474980206 posted

    you should do a:

      docker-compose build

    then

       docker images

    to check that the image was created correctly.  then

       docker-compose push

    note:  your compose file is missing the build command

    Wednesday, March 17, 2021 10:14 PM
  • User-2054057000 posted

    The procedure is simple. 

    1. You have to push the images to Azure Container Registry or Docker Hub.
    2. Then upload your docker compose file to Azure and tell it from where it has to fetch the images for your app.

    Check this video which does this work - Deploy Multi-Container ASP.NET Core app on Dockers to Azure Container Instances

    Friday, March 19, 2021 5:27 AM
  • User1846752346 posted

    thanks for your reply @bruce. I however proceeded to create an app service with docker images with ACR. There inside of app service, under container instances, there is an option (in preview) to select/create a docker-compose file. So I made changes there and got my multi-container app running. What are your views on this approach?

    I am unaware of docker-compose build command. Will definitely try this approach that you mentioned. 

    Saturday, March 20, 2021 5:10 AM
  • User1846752346 posted

    thanks for your reply @yogyogi. I however proceeded to create an app service with docker images with ACR. There inside of app service, under container instances, there is an option (in preview) to select/create a docker-compose file. So I made changes there and got my multi-container app running. What are your views on this approach?

    I'll try to deploy on ACI as well.

    Saturday, March 20, 2021 5:11 AM
  • User-2054057000 posted

    Actually this is in preview mode and does not have much options to manage container. For production use Azure Container Instances, they are very good. I have provided you with the link eariler, do check it.

    Thursday, March 25, 2021 9:43 AM