Skip to content

Initialize volumes when container is created#9089

Merged
jessfraz merged 1 commit intomoby:masterfrom
cpuguy83:8942_create_volumes_on_create
Dec 3, 2014
Merged

Initialize volumes when container is created#9089
jessfraz merged 1 commit intomoby:masterfrom
cpuguy83:8942_create_volumes_on_create

Conversation

@cpuguy83
Copy link
Member

Fixes #8942
Current behavior is that volumes aren't initialized until start.
Volumes still need to be initialized on start since VolumesFrom and
Binds can be passed in as part of HostConfig on start, however anything
that's already been initialized will just be skipped as is the current
behavior.

@cpuguy83 cpuguy83 force-pushed the 8942_create_volumes_on_create branch from 6827c3b to ea71835 Compare November 11, 2014 16:48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you have to mount?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably because we it is copying stuff from the container fs.

@SvenDowideit
Copy link
Contributor

Docs LGTM - @jamtur01 @fredlf

but you may need to add some more info (do we talk about volume creation and lifecycles yet, because we should :)

so this means we can change our volume container docs to show you can

docker create --name bananas --volume /data busybox
docker run -it --volumes-from bananas busybox sh

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you're referring to code directly (create?), this should probably be: Volumes are now initialized when created.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Volumes are now initialized when created.

Perhaps better; "Volumes are now initialized when the container is created."?

(But the original could work too, to indicate that the create command is involved here)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's kind of my point. If we're referring to the command, we should be explicit: Building the container with create will now initialize the volume.

If not, @thaJeztah's revision is probably better than mine.

@cpuguy83 cpuguy83 force-pushed the 8942_create_volumes_on_create branch from ea71835 to 88c497e Compare November 14, 2014 16:23
@cpuguy83
Copy link
Member Author

@fredlf Updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a stray "on"; 'initialized on when' should be 'initialized when'

Fixes moby#8942
Current behavior is that volumes aren't initialized until start.
Volumes still need to be initialized on start since VolumesFrom and
Binds can be passed in as part of HostConfig on start, however anything
that's already been initialized will just be skipped as is the current
behavior.

Signed-off-by: Brian Goff <[email protected]>
@crosbymichael
Copy link
Contributor

LGTM

@crosbymichael
Copy link
Contributor

ping @jfrazelle ;)

@jessfraz
Copy link
Contributor

jessfraz commented Dec 3, 2014

LGTM

jessfraz pushed a commit that referenced this pull request Dec 3, 2014
Initialize volumes when container is created
@jessfraz jessfraz merged commit 67fda33 into moby:master Dec 3, 2014
@jessfraz
Copy link
Contributor

jessfraz commented Dec 3, 2014

cherry-picked for 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to use --volumes-from with an unstarted container made with docker create

7 participants