I’m trying to automate the process of updating a deployed image, so started experimenting with rancher-compose.
I have two containers that I want to deploy: nginx-demo which depends on flask-demo. Each project/container has its own repo and directory, which contains the associated Dockerfile, docker-compose.yml and rancher-compose.yml (see below)
(The first hurdle was rancher-compose’s dependency on S3; it’s not clear to me why I need an AWS account in the first place to use Rancher (on Digital Ocean) and I was expected any required container image state to be stored in the named Docker registry, but I created the required AWS credentials and set the environment variables.)
At first, “rancher-compose up” seems to succeed, but the UI shows the nginx container constantly restarting. Checking the logs I see that there’s a configuration error.
host not found in upstream "FLASK:5000"
The config was tested locally and works. I.e., “docker-compose up” works locally.
ISSUE 1: The “links” directive in the docker-compose file seems to have worked since in the UI I can jump from the nginx service to the linked flask service – and it has the name “FLASK”.
However, in trying to debug, I make a change to the config (renaming “FLASK”), then rerun “docker-compose build” and “rancher-compose up”.
ISSUE 2: There is no sign of the config changes (i.e., I get the same error in the log). It’s not unless I DELETE the project from the UI and then rerun “rancher-compose” do the changes show up.
ISSUE 3: “rancher compose rm -f” reports “Deleted”, but both services still show up in the UI (both service definitions and instances).
At the very least, Rancher should show the underlying docker commands that are being issued to the server.
flask-demo/docker-compose.yml
flask:
build: .
ports:
- "5000:5000"
nginx-demo/docker-compose.yml
flask:
extends:
file: ../flask-demo/docker-compose.yml
service: flask
nginx:
build: .
ports:
- "80:80"
links:
- flask:FLASK
nginx.conf
upstream flask {
server FLASK:5000;
}