This repository demos how to use rancher-compose to create a hello world container. the docker image that be used in this demo is from https://hub.docker.com/r/kitematic/hello-world-nginx
In this link https://forums.rancher.com/t/rancher-compose-and-local-dockerfile-using-build/612 it describes how to use Docker Remote API in docker-compose and rancher-compose to create a container. This demo doesn't go with this solution. TODO - A seperate demo will be created and go with this solution.
This demo goes with this solution
- Clone this repository
- in bash console, cd to the repository folder
- run
rancher-compose --debug up -d
- --debug is used for display debug information in bash console
- -d runs the container in detached mode. Go to https://docs.docker.com/compose/reference/up/ to find more detail.
-
If
rancher-compose up
is run successfully, rancher will create a service for you, named 'helloworld'. Then I tried change the local docker-compose file and the change didn't influence the subsequntrancher-compose up
command. I have to runrancher-compose rm helloworld
to remove the existing service, and then your local docker-compose.yml will be used by rancher again. -
I'm using MacOS to learn Rancher. By the time I do my learning, Docker for Mac doesn't support Rancher, but there is a workaround. Read the issue I submitted at rancher/rancher#9717 to find more detail; another issue is also FYI at rancher/rancher#9742