SvenDowideit / dockerfiles

dockerfiles that I use
http://fosiki.com
MIT License
212 stars 60 forks source link

samba - allow mouting a volume directly form the host without specifying a container. #24

Closed krasi-georgiev closed 9 years ago

krasi-georgiev commented 9 years ago

I am trying to use the image with fig , but seems that fig auto generates the container names so there is no way to specify the container for the volumes.

I think an additional ENV should exist to specify whether the image should mount volumes from a container or directly from the host.

krasi-georgiev commented 9 years ago

Just now I realised that there are other issues as well and in the current form this image cannot be used with fig.

fig relies on auto generating the contained names and since the container name here is static then fig cannot stop it because it is looking for a container with a different name.

It is great that the image itself is taking care of auto stopping a running container , but maybe another ENV should be added to disable this functionality.

dreamcat4 commented 9 years ago

@vipconsult I think you should try to put this in Sven's script:

1) get container name of the master container 2) get container ID of the master container (should be in the env var $HOSTNAME). Remove, strip the [a-f] digits of it. Take the first few digits enough to be unique (say 12 digits).

Trim last digit on the end of the master container's name (the instance number, which should normally be _1) and replace it with the unique identifying digits taken form the container_id.

Then fig should probably see it and stop it.

I have also raised a pull request on fig itself to make fig be able to recognise proper container ids (with hex digits) in the instance number part at the end (rather than just a 0-9 number) like _1.

https://github.com/docker/fig/pull/831

SvenDowideit commented 9 years ago

closed by #23 ?