Push current docker container

docker

#1

Hey guys,

So ive started playing with the circle 2.0 and afther some tweaking with the caching layer its really awesome! Fast etc! its just great. But…

My setup consists of a docker image that has to run some tests, and when the test pass that container needs to be tagged and pushed. I see no way of doing this in an efficient manner. The only way this is possible (as far as i can see) is to use setup_remote_container as described here https://circleci.com/docs/2.0/building-docker-images/ and than build it again and then push it.

This just seems quite redundant to me. And its obviously quite inefficient.

Is there a way of tagging an pushing the primary container?

Thanks guys


#2

No you can’t push the container from within itself. You need the machine executor to simplify what you’re doing.


#3

Hi Rohara,

thanks for reaching out, im only clueless about what you mean. Could you elaborate?

Thans


#4

Hi Rohara,

So ive found the machine executor. Only this adds between 30 to 60 secs to my build time and the advantages of docker are lost. And to be honest im a bit confused. As as far as i can see ive got a “default” docker setup so for me to deploy a new version i need to do the following:

  • Build my container
  • Check out the code
  • Run the test suite

Than… if the tests are fine

  • Run an additional command in the container RAILS_ENV=production bin/rake assets:precompile
  • Tag the container
  • Login to Amazon
  • Push the container to Amazon ECR
  • Add a new task revision to Amazon ECS
  • Update the Amazon ECS service so it knows about the new task

Obviously the awscli needs to be installed.

Only what strikes me as odd, is that we can only spin up a container and test it with the full benefits of docker. I mean, its awesome and blazing fast. If you compare it to CircleCi 1.0 the test suite is done in 40% of the time. I love it. So the testing part is greately improved.

Only there is no way to deploy this container… The only way to do this is to forget about the docker executor and use the machine executor. And than im just as fast as the CircleCi 1.0 features.

Could you give me some pointers on this?


#5

I don’t really have any pointers about that specifically but I’ve passed on your feedback to the people actually making the platform. :slight_smile:


#7

Hi Rohara,

Did you get some feedback from the dev’s?

I’d like to build my CircleCi 2.0 stack, but this issue is confusing my choice. Using docker or the machine executor.

Thanks!


#8

No. I opened a feature request for you. This is not going to be supported in the near future. This is pretty low priority over a lot of other 2.0 features.


#9