Skip to content

Add --tmpfs to allow dirs to be mounted in tmpfs - #9586

Closed
crosbymichael wants to merge 3 commits into
moby:masterfrom
crosbymichael:tmpfs-mounts
Closed

crosbymichael wants to merge 3 commits into
moby:masterfrom
crosbymichael:tmpfs-mounts

Conversation

@crosbymichael

Copy link
Copy Markdown
Contributor

By using docker run --tmpfs /tmp docker will mount the dir /tmp in tmpfs for the container.

@jessfraz

jessfraz commented Dec 9, 2014

Copy link
Copy Markdown
Contributor

omg yes, I do this a lot

@LK4D4

LK4D4 commented Dec 9, 2014

Copy link
Copy Markdown
Contributor

Implementation okay for me. Maybe deserves api docs as well. Also, is this possible to write test for this?

@tianon

tianon commented Dec 10, 2014

Copy link
Copy Markdown
Member

Does it copy the image contents at the path like volumes do? (just checking, since it's not exactly obvious from the code) 👼

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@thaJeztah no they are not related at all

@tianon no, that is magic

@tianon

tianon commented Dec 10, 2014

Copy link
Copy Markdown
Member

Then this won't ever work for --tmpfs /run.

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@tianon yes, I know. It depends the problem is not copying things into a tmpfs mounted /run but that most daemons execed within docker are not done by the init scripts that usually setup the initial dir structure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should it be tmpfs (code)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I feel like we should at least expand the abbreviation for users who might not be familiar with it.

@SvenDowideit

Copy link
Copy Markdown
Contributor

Docs LGTM - though it is sparse, should we define tmpfs, and tell a user why to use it

@fredlf @jamtur01

@crosbymichael what about docker build?

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@SvenDowideit no build for now

@crosbymichael crosbymichael added this to the 1.5.0 milestone Dec 17, 2014
@fredlf

fredlf commented Dec 18, 2014

Copy link
Copy Markdown
Contributor

LGTM, but agree with Sven that a little more context/background would help a lot.

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@fredlf @SvenDowideit what do you suggest? If you don't have a usecase for such a thing we or someone should't be telling you why you should use it. If you need this type of feature you know exactly why you would use it. I don't like having docs that tell people solutions to problems that they don't have.

@fredlf

fredlf commented Dec 18, 2014

Copy link
Copy Markdown
Contributor

All I'm looking for is an expansion of the abbrev. and some hint of its possible application in a Docker env. Just citing fairly obscure abbreviations with no explanation makes docs unnecessarily obtuse. Maybe a user has a Docker problem they could solve with tmpfs, but they don't know about it?

@crosbymichael

Copy link
Copy Markdown
Contributor Author

tmpfs is not an abbreviation it's the full name for the filesystem.

"tmpfs is a common name for a temporary file storage facility on many Unix-like operating systems."
"tmpfs is a temporary filesystem that resides in memory and/or your swap partition(s), depending on how much you fill it up"
"This paper describes tmpfs, a memory-based file system"

@fredlf

fredlf commented Dec 18, 2014

Copy link
Copy Markdown
Contributor

Gawd, engineers can be so literal. :-)

Not abbreviation, then, term.

The --tmpfs flag will mount the specified directories in a temporary file system created for the container using tmpfs. This may be useful for....

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@fredlf ok, well why didn't you say so, that sounds totally reasonable to me ;)

I was not trying to be difficult on purpose, sorry for any confusion with what I was saying and what you were trying to tell me. I just didn't want us adding things to the documentation explaining in depth use cases for things such as this because it's much more important as to why one should not use such a feature than what you can do with it. For the users who don't already know use cases for tmpfs there is no amount of documentation that we could provide to them to give them the information that they need to make an educated decision.

Sorry, I just misunderstood what you were initially asking for. I'll make the updates.

@fredlf

fredlf commented Dec 18, 2014

Copy link
Copy Markdown
Contributor

Ha, no worries at all. Communication is hard.

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@fredlf @SvenDowideit I updated the paragraph in the documentation for tmpfs. Please take a look again.

@fredlf

fredlf commented Dec 19, 2014

Copy link
Copy Markdown
Contributor

@crosbymichael LATM (looks awesome to me), thanks for your patience!

@SvenDowideit

Copy link
Copy Markdown
Contributor

Docs LGTM - merci - this version is quite unambiguous to me :)

@crosbymichael

Copy link
Copy Markdown
Contributor Author

@LK4D4 I added an integration test for tmpfs mounts

@LK4D4

LK4D4 commented Jan 8, 2015

Copy link
Copy Markdown
Contributor

@crosbymichael Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be in 1.17? Also description in hostconfig section is needed. Also I remember that somewhere should be "what's new" section.

@jessfraz

jessfraz commented Jan 8, 2015

Copy link
Copy Markdown
Contributor

LGTM minus the docs comment above about the version :)

@crosbymichael

Copy link
Copy Markdown
Contributor Author

I'll reopen when this is ready, going to reconsider the volume proposal and copy functionality

@alberts

alberts commented Feb 19, 2015

Copy link
Copy Markdown

@crosbymichael Any thoughts on the next steps here? Lots of proposals flying around:

#9803
#9250
#8484

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.

7 participants