2

I'm trying to containerize application which consists of two services defined. One is basic server running on specific port and second one is SSH server. The first service creates users by executing standard unix commands (managing user and their ssh keys) and they can login to second ssh service. Each service is running in separate container and I use Docker Compose to make it all running together.

The issue is that I'm unable to define Docker volumes so that I can user created by first service can use second service. I need share files like /etc/passwd, /etc/shadow, /etc/group between both services.

What I tried:

1) Define volumes for each file

  • Not supported in Docker Compose (it can use only directories as volumes)

2) Replace /etc/passwd with symlink to copy in volume

3) Set whole /etc as volume

  • doesn't work (only some files get from image to volume)
  • is ugly

I would be thrilled with any suggestion or workaround which wouldn't require put both services in one container.

Community
  • 1
  • 1
StepanOrt
  • 21
  • 2
  • 2
    Compose can support files as a volume. The issue is that it has no extension, so compose is by default (and maybe it's the engine returning the error, not compose, I haven't checked the code yet) treating it like a directory which doesn't exist I believe. – johnharris85 Jul 21 '16 at 16:12

0 Answers0