3

I have docker-compose.yml file present in the repository. I have added the image attribute in one of the services to pull the docker images. I have not hard coded the docker image and docker tag and planning to pass these arguments at the runtime to docker-compose.yml file.

How to pass the runtime arguments like IMAGE_TAG=82, IMAGE_NAME=app1 to the docker-compose.yml file?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Kumaresh Babu N S
  • 1,648
  • 5
  • 23
  • 39

1 Answers1

2

You can use variables in the docker-compose file for the image & tag:

version: '3'
services:
    redis-server:
       image: ${IMAGE_NAME}:${IMAGE_TAG}

And pass the arguments in the docker-compose task:

enter image description here

You can also define pipeline variables and check the "Settable at release time":

enter image description here

So when you click on "Create Release" you can replace the values:

enter image description here

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114