Docker Community Forums

Share and learn in the Docker community.

Can I tell docker to take a dependency that is not an image from my PC?


(Ahaddad) #1

Let’s say that I have the following dependency:
A -> B -> C
A and C are images, and I have B on my PC (not as image). Is it possible to use docker compose to tell docker to do such linking? If not, what is an alternative?

Thanks


(David Maze) #2

What do you mean by “linking”?

Can you build a Docker image out of program B?


(Ahaddad) #3

By “linking” I refer to “links:” term that can be used in docker compose.

I can build a docker image out of B, but I’m asking whether I can run the process without building an image of B.


(David Maze) #4

Then, no: docker run --link and its Docker Compose equivalent are strictly between containers.

I believe the current recommendation (especially if you’re using current Compose) is to set up a private network for your application, and then Docker will provide an internal DNS service; you don’t need links any more. You could use the docker network create --aux-address option to set up a DNS name that pointed at service B.

You might find it simplifies things. If your final application deployment is going to be all-Docker, working in a replica of that environment will help you get around problems like missing dependencies that happen to be installed on your host system but not in the container, and other connectivity issues.