Juju with docker



One question:
I have a juju machine with docker container. inside the machine I have another application container(which is created from dockerfile).
I have another juju machine with an application. now, I want to make a relation between this two application.

Keep it mind, one application is inside the juju machine then docker container.
Is it possible? I saw something about layer but not getting how to make a relation.