Forum Discussion

Missel18's avatar
Missel18
Copper Contributor
Feb 15, 2024

Using docker-compose with pipeline

Hello,

 

I am facing a strange situation with docker compose within a pipeline.

 

I have a project with two containers, back and front (and a third for network). 

 

With my pipeline i am able to use build and push images functions from Docker. my azure devops and azure are two distinct tenant. I connected my container registry through service connection and it works fine.

What i am looking for is to be able to down and up my images using docker-compose.

 

Here is my docker-compose content :

 

version"3.9"
services:
  front:
    container_namefront
    domainname"[registry]"
    image: [registry].azurecr.io/front:1
    ports:
      - "3007:3007"
    depends_on:
      - back
    restartalways

  back:
    container_nameback
    domainname"[registry]"
    image: [registry].azurecr.io/back:1
    environment:
      - "ASPNETCORE_URLS=http://*:5009"
    ports:
      - "5009:5009"
    restartalways
 
In my pipeline, my two steps down and up run and end with no error, but in reality nothing happened and i do not know why...
 
Any ideas ?
 
Thansk for your time
  • Missel18's avatar
    Missel18
    Copper Contributor

    For me the solution should be in my context.

     

    With i run my pipeline my context is :

    /usr/bin/docker context ls
    NAME DESCRIPTION DOCKER ENDPOINT ERROR
    default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock
    Finishing: context
     
    I tried to created my own context to be connexted to my ressource group but the formula following is not working.
     
    docker context create aci [name]--subscription-id [id] --resource-group [nameRG]
     
    --> unknown flag: --subscription-id
     
    Any ideas ?