Mount from host filesystem #68
Comments
I think the MOUNT_FROM_HOST would be best - that keeps it separate from the old VOLUMES_FROM implementation that I'm not super fond of anyways. |
Thats strange, it works perfectly if I leave out the echo in the following code: MOUNT_FROM_HOST=$(grep -i "^# MOUNT_FROM_HOST" $DOCKERFILE)
if [ -n "$MOUNT_FROM_HOST" ]
then
HOST_PATH=$(grep -i "^# MOUNT_FROM_HOST" $DOCKERFILE | awk '{ print $3 }')
CONTAINER_PATH=$(grep -i "^# MOUNT_FROM_HOST" $DOCKERFILE | awk '{ print $4 }')
if [ -n "$CONTAINER_PATH" ]
then
MOUNT_PATH="$HOST_PATH:$CONTAINER_PATH"
else
MOUNT_PATH="$HOST_PATH:$HOST_PATH"
fi
RUN_OPTIONS="$RUN_OPTIONS -v $MOUNT_PATH"
echo "Mounting at $MOUNT_PATH"
fi Otherwise it throws a error "Image with the name Mounting not found"(or something like that). Any ideas? |
You shouldn't likely echo in there - it's building a bunch of command line flags for the |
I had implemented this a little while ago but only pushed it this morning. 👍 to having this merged in. |
Kinda confusing, because there actually is an echo, inside the "linking container"-block, which I used as a snippet. Nonetheless, it works as expected and I have been using it in Production since a week, so it could be merged: For the docs: # MOUNT_FROM_HOST /etc/data results in # MOUNT_FROM_HOST /host/data/docker-data /docker/container/data results in (Hint: be aware, that file owner and permissions have to match in order for the container to read/write on the mounted folder!) |
This is exactly what I need to get shipyard working. Please can we get this into master? Is there anything I can do to help? |
I will merge as soon as I can. Will try to merge tomorrow. Traveling at the moment with really crappy hotel internet. |
Thanks. I'm loving octohost. "Man, I'm going to have so many chickens when this lot hatch!" On Wed, Sep 24, 2014 at 12:21 PM, darron froese notifications@github.com
|
Added an _magic_ option mount host folder to container (#68)
Yes, I know this is against Dockerfile best practice, but it's really required in my usecase. For backup and portability reasons all Docker container share a specific folder with the host filesystem. The approach so far was to manually create data-only-container and share them with the actual container.
I am willing to implement this feature into octohost, if you agree to one of this implementations:
Do you agree, that this feature would be useful?
Which implementation do you prefer?
The text was updated successfully, but these errors were encountered: