Import Dockerfile for Stack services

Hi all,

New to Rancher, using DigitalOcean to deploy to, and for the most part it is pretty nice.

I want to set up my app architecture, I assume that is what Stacks are for. Assuming that is correct, I have a couple of issues I am not able to find details on.

First, I have my local dev setup using Docker compose, with individual Docker files to build each of my Docker images. I suspect that the equivalent Rancher construct is Service. I have a DB Dockerfile, one for my API service tier, another for my Consul tier, and hoping to also fit in an ELK/Logstash setup as part of this Stack. What I cant seem to find is how do I import my own Dockerfile for each Service? Right now I get empty Ubuntu 14.04 instances. What is the process to bypass the limited blank slate UI options and use the same Docker compose/Dockerfiles I use locally? I really liked the idea of being able to export the Stack Docker compose and run it locally, but without the ability to specify Dockerfiles and get everything built as I need, I am seemingly doing this backwards.

Second, and maybe I asked this above… I want to be able to run the same setup in my dev environment as I do in production, with the added benefit of scaling stack services as needed. Assuming my first issue can be solved, is it as simple as exporting the Stack Docker compose file and using that locally? Or is there a number of steps involved to match my local dev env to the Stack deployment?

I really was hoping I could set things up with Docker compose locally, then simply push the docker compose file up (I see there is an option to select that), but I cant see how when I specify in my compose file the Dockerfile build scripts, those get included? Or, is there some hidden method to do this?

Thank you.

Hi,

I think your problem is you are building docker images within your docker-compose by calling dockerfiles directly.

To deploy on a rancher env you should push your images to dockerhub or to a docker registry. Your docker compose should make references to docker images tags and not dockerfiles.

Hope it may help.

1 Like

Thanks for the answer. I think it is helpful!