Doubt about CI/CD to build and release Docker containers?

Asked

Viewed 90 times

1

I am building a Docker container release pipeline in Gitlab and Azure Devops. But I came across the following situation:

Step do build:

docker build -f ./caminho_docker_file -t nome_minha_imagem .
docker tag nome_minha_imagem:latest url/nome_minha_imagem:latest
docker push url/nome_minha_imagem

Step of the release:

 - aws ecs update-service 
 # apenas para pegar a ultima versão enviada e propagar nos containers 

With the above configuration, it works well when I have only one build and in sequence I perform the release of the release.

The problem is when I have a build and take time to release. And with that other builds can be fired. That is I will have a build tied to a release, but when my release is executed it will not propagate the image of my build but of my last build not linked to release.

I wonder if there is some way for example I put the image in the Docker generated in my build in ARTIFACT (and not send to cloud at the time of build) sent to my release, with this I will have the guarantee that my release is sending the image of the correct build.

I looked in the documentation and in some tutorials but I did not find, if someone can explain me the best way and if you have how to accomplish this thank you.

  • 1

    in general, you need to change your build and release process to instead of depending on the Latest tag, you create a tag with the reference of this build for later release.

  • Just so you understand, do you run the same pipeline on Azure Devops and Gitlab and send it to an AWS Registry? And your ECS is configured to use this Registry automatically with the Latest tag?

  • Yes, that which is configured

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.